:root {
  color-scheme: dark;
  font-family: "Google Sans Flex", "Google Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #e8f6ff;
  --muted: #8aa3b7;
  --line: rgba(56, 189, 248, .34);
  --panel: rgba(3, 10, 20, .88);
  --page: #02050b;
  --fire: #ff3b1f;
  --water: #00a7ff;
  --steel: #a8b0b8;
  --accent: #0ea5e9;
  --gold: #f6b73c;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(14, 165, 233, .14), transparent 34%),
    linear-gradient(115deg, rgba(14, 165, 233, .08), transparent 28%, rgba(239, 68, 68, .06) 72%, transparent),
    var(--page);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid rgba(56, 189, 248, .38);
  border-radius: 6px;
  padding: 0 14px;
  background: linear-gradient(180deg, rgba(14, 165, 233, .22), rgba(2, 6, 23, .92));
  color: #dff6ff;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: inset 0 0 18px rgba(14, 165, 233, .14);
}

button.secondary {
  background: rgba(5, 12, 24, .82);
  color: #9cc9e7;
  border-color: rgba(148, 163, 184, .26);
}

button.danger {
  background: linear-gradient(180deg, rgba(239, 68, 68, .34), rgba(31, 7, 7, .94));
  border-color: rgba(248, 113, 113, .55);
}

button:disabled {
  opacity: .55;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(56, 189, 248, .32);
  border-radius: 6px;
  padding: 0 12px;
  background: rgba(1, 6, 14, .88);
  color: var(--ink);
}

.app-shell {
  max-width: 1500px;
  margin: 0 auto;
  padding: 16px 18px 118px;
}

.topbar,
.panel,
.beast-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, .18), transparent 32%),
    linear-gradient(225deg, rgba(148, 163, 184, .12), transparent 34%),
    rgba(2, 6, 23, .92);
  box-shadow: inset 0 0 24px rgba(14, 165, 233, .14), 0 10px 32px rgba(0, 0, 0, .42);
  clip-path: polygon(0 0, 96% 0, 100% 26%, 100% 100%, 4% 100%, 0 74%);
}

.profile-plate {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.avatar-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(56, 189, 248, .68);
  border-radius: 999px;
  color: #7dd3fc;
  font-weight: 900;
  box-shadow: inset 0 0 20px rgba(14, 165, 233, .28), 0 0 18px rgba(14, 165, 233, .2);
}

.profile-name {
  display: block;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand {
  display: block;
  justify-self: center;
  color: #e5e7eb;
  font-size: clamp(1.8rem, 4vw, 3.6rem);
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 0 16px rgba(14, 165, 233, .72), 2px 2px 0 rgba(239, 68, 68, .45);
}

.status-pill {
  display: inline-flex;
  margin-top: 3px;
  color: #38bdf8;
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.view-stack {
  display: grid;
  gap: 14px;
  padding: 14px 0 28px;
}

.panel {
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, .12), transparent 34%),
    rgba(3, 10, 20, .88);
  box-shadow: inset 0 0 24px rgba(14, 165, 233, .09);
}

.panel h1,
.panel h2 {
  margin: 0 0 12px;
  line-height: 1.05;
  text-transform: uppercase;
  color: #f8fbff;
}

.pack-card p {
  min-height: 44px;
  color: var(--muted);
}

.muted-copy {
  color: var(--muted);
}

.collection-screen {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(14, 165, 233, .44);
  border-radius: 6px;
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(14, 165, 233, .13), transparent 28%, rgba(239, 68, 68, .06)),
    rgba(1, 6, 14, .82);
  box-shadow: inset 0 0 30px rgba(14, 165, 233, .12);
}

.collection-header {
  display: grid;
  grid-template-columns: auto minmax(220px, 320px) auto;
  align-items: center;
  gap: 18px;
  padding: 0 4px 10px;
  border-bottom: 1px solid rgba(14, 165, 233, .28);
}

.collection-header h1 {
  margin: 0;
  color: #f8fbff;
  font-size: clamp(1.4rem, 3vw, 2rem);
  text-transform: uppercase;
}

.collection-header span {
  color: #dbeafe;
  font-weight: 900;
}

.search-field input {
  min-height: 46px;
  padding-right: 42px;
}

.view-toggle {
  display: inline-flex;
  justify-self: end;
  gap: 8px;
}

.view-toggle span {
  display: grid;
  place-items: center;
  min-width: 58px;
  min-height: 44px;
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 6px;
  color: #64748b;
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.view-toggle .is-active {
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, .62);
  box-shadow: inset 0 0 18px rgba(14, 165, 233, .2);
}

.collection-layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 18px;
}

.filter-rail {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border: 1px solid rgba(14, 165, 233, .26);
  border-radius: 6px;
  background: rgba(2, 8, 17, .84);
}

.filter-rail h2,
.filter-rail h3 {
  margin: 0;
  color: #38bdf8;
  text-transform: uppercase;
}

.filter-rail h3 {
  margin-top: 10px;
  color: #cbd5e1;
  font-size: .84rem;
}

.filter-rail button {
  justify-content: start;
  text-align: left;
}

.filter-rail button.is-active {
  color: white;
  border-color: #38bdf8;
  box-shadow: inset 0 0 18px rgba(14, 165, 233, .26), 0 0 18px rgba(14, 165, 233, .14);
}

.collection-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.battle-tabs {
  margin-bottom: 12px;
}

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

.element-battle-button {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 250px;
  padding: 18px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 42%, rgba(14, 165, 233, .18), transparent 38%),
    rgba(2, 6, 23, .92);
}

.element-battle-button img {
  width: min(100%, 220px);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, .12));
}

.element-battle-button span {
  color: white;
  font-size: clamp(1.2rem, 3vw, 2rem);
  line-height: 1;
  text-shadow: 0 0 14px currentColor;
}

.element-battle-button small {
  color: #9cc9e7;
  font-size: .82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.element-battle-button.element-Fire {
  border-color: rgba(255, 59, 31, .68);
  box-shadow: inset 0 0 24px rgba(255, 59, 31, .13), 0 0 20px rgba(255, 59, 31, .1);
}

.element-battle-button.element-Water {
  border-color: rgba(0, 167, 255, .7);
  box-shadow: inset 0 0 24px rgba(0, 167, 255, .16), 0 0 20px rgba(0, 167, 255, .12);
}

.element-battle-button.element-Steel {
  border-color: rgba(168, 176, 184, .62);
  box-shadow: inset 0 0 24px rgba(168, 176, 184, .1), 0 0 20px rgba(168, 176, 184, .08);
}

.element-battle-button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.battle-advanced-prompt {
  display: flex;
  justify-content: center;
}

.xb-arena,
.battle-result {
  position: relative;
  overflow: hidden;
  border: 1px solid #0ea5e9;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, .16), transparent 36%),
    linear-gradient(225deg, rgba(220, 38, 38, .14), transparent 34%),
    #050914;
  color: #e5f4ff;
  box-shadow: inset 0 0 34px rgba(14, 165, 233, .16), 0 16px 40px rgba(2, 6, 23, .2);
}

.xb-arena {
  display: grid;
  gap: 16px;
  padding: 14px;
}

.xb-versus-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.xb-combatant {
  display: grid;
  min-height: 74px;
  align-content: center;
  border: 1px solid rgba(14, 165, 233, .45);
  border-radius: 8px;
  padding: 12px;
  background: rgba(2, 6, 23, .72);
}

.xb-combatant-opponent {
  border-color: rgba(248, 113, 113, .55);
  text-align: right;
}

.xb-combatant strong {
  font-size: clamp(1rem, 2vw, 1.45rem);
  text-transform: uppercase;
}

.xb-combatant span,
.xb-countdown span {
  color: #9cc9e7;
  text-transform: uppercase;
  font-size: .78rem;
  font-weight: 700;
}

.xb-vs-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(56, 189, 248, .65);
  border-radius: 8px;
  color: #7dd3fc;
  font-size: 1.5rem;
  font-weight: 900;
  text-shadow: 0 0 16px rgba(56, 189, 248, .9);
}

.xb-element-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.xb-element {
  min-height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, .35);
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, .72);
  font-weight: 900;
  text-transform: uppercase;
}

.xb-element.is-selected {
  border-color: #38bdf8;
  color: white;
  box-shadow: 0 0 18px rgba(14, 165, 233, .42);
}

.element-Fire.is-selected {
  border-color: #ef4444;
  box-shadow: 0 0 18px rgba(239, 68, 68, .42);
}

.element-Steel.is-selected {
  border-color: #94a3b8;
  box-shadow: 0 0 18px rgba(148, 163, 184, .32);
}

.xb-battle-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.xb-arena-card {
  max-width: 260px;
  width: 100%;
  justify-self: center;
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, .55);
  border-radius: 8px;
  background: rgba(2, 6, 23, .9);
}

.xb-arena-card-opponent {
  border-color: rgba(248, 113, 113, .6);
}

.xb-arena-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.xb-arena-card div {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.xb-arena-card span {
  color: #9cc9e7;
  font-size: .78rem;
}

.xb-countdown {
  display: grid;
  place-items: center;
  gap: 8px;
  min-width: 110px;
}

.xb-countdown strong {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  border: 2px solid rgba(56, 189, 248, .75);
  border-radius: 999px;
  color: white;
  font-size: 2.5rem;
  text-shadow: 0 0 18px rgba(56, 189, 248, .9);
  box-shadow: inset 0 0 22px rgba(56, 189, 248, .22), 0 0 24px rgba(56, 189, 248, .2);
}

.battle-result {
  border-width: 2px;
  padding: 20px;
  text-align: center;
}

.battle-result h1 {
  font-size: clamp(2.2rem, 8vw, 5rem);
  letter-spacing: 0;
  margin: 0 0 12px;
  text-shadow: 0 0 18px rgba(56, 189, 248, .62);
}

.battle-final {
  display: grid;
  gap: 18px;
}

.battle-final__cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.battle-final__summary {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.battle-final__summary p {
  margin: 0;
  color: #7dd3fc;
  font-size: clamp(1rem, 3vw, 1.45rem);
  font-weight: 900;
  text-transform: uppercase;
}

.battle-final__summary > strong {
  color: #7dd3fc;
  font-size: clamp(2.2rem, 8vw, 4.5rem);
  line-height: 1;
  text-shadow: 0 0 18px rgba(56, 189, 248, .8);
}

.battle-final__summary > span {
  color: #9cc9e7;
  font-size: .8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.result-win {
  border-color: #38bdf8;
}

.result-loss {
  border-color: #ef4444;
}

.result-loss h1 {
  text-shadow: 0 0 18px rgba(239, 68, 68, .62);
}

.result-draw {
  border-color: #94a3b8;
}

.grid {
  display: grid;
  gap: 12px;
}

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

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

.stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(1, 6, 14, .64);
}

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

.stat strong {
  font-size: 1.35rem;
  color: #f8fbff;
}

.form-row {
  display: grid;
  gap: 10px;
  margin: 10px 0;
}

.admin-form {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.admin-form h3 {
  margin: 0;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-row input {
  width: auto;
  min-height: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.tabs button {
  white-space: nowrap;
}

.message {
  padding: 10px 12px;
  border: 1px solid rgba(56, 189, 248, .48);
  border-radius: 6px;
  background: rgba(8, 47, 73, .9);
  color: #bae6fd;
}

.message.error {
  border-color: rgba(248, 113, 113, .55);
  background: rgba(69, 10, 10, .9);
  color: #fecaca;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 18px;
}

.filters {
  margin-top: 14px;
}

.beast-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(56, 189, 248, .15), transparent 24%),
    rgba(2, 6, 23, .94);
  box-shadow: inset 0 0 16px rgba(14, 165, 233, .13), 0 12px 24px rgba(0, 0, 0, .28);
}

.beast-card__art {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #050914;
  box-shadow: none;
  cursor: zoom-in;
}

.beast-card__art img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center 15%;
    transform: scale(1.5);
    background: #050914;
    margin: 0 0 0 20px;
}

.beast-card__body {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-top: 1px solid rgba(56, 189, 248, .2);
}

.beast-card__body strong {
  color: #f8fbff;
  text-transform: uppercase;
}

.beast-card__body span {
  color: #9cc9e7;
  font-size: .82rem;
}

.card-count-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 2px solid rgba(226, 232, 240, .92);
    border-bottom-left-radius: 12px;
  background:
    radial-gradient(circle at 40% 28%, rgba(255, 255, 255, .18), transparent 26%),
    rgba(8, 9, 13, .96);
  color: white;
  font-size: 1.45rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .1), 0 0 18px rgba(255, 255, 255, .1);
}

.card-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  padding: clamp(14px, 3vw, 36px);
  background:
    radial-gradient(circle at 50% 35%, rgba(14, 165, 233, .12), transparent 34%),
    rgba(0, 0, 0, .9);
  backdrop-filter: blur(6px);
  overflow: auto;
}

.card-overlay__panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(280px, 460px);
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 4vw, 44px);
  width: min(100%, 980px);
  max-height: min(92vh, 820px);
  overflow: auto;
  padding: clamp(16px, 3vw, 34px);
}

.card-overlay__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.card-overlay__image {
  --mx: 50%;
  --my: 50%;
  --rx: 0deg;
  --ry: 0deg;
  --shine-x: 50%;
  --shine-y: 50%;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 6px;
  background: #050914;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .28s ease, box-shadow .28s ease;
  will-change: transform;
}

.card-overlay__image::before,
.card-overlay__image::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity .24s ease;
}

.card-overlay__image::before {
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .62), transparent 11%),
    linear-gradient(115deg, transparent 18%, rgba(255, 255, 255, .34) 42%, rgba(255, 255, 255, .06) 48%, transparent 62%);
  background-position: var(--shine-x) var(--shine-y), center;
  mix-blend-mode: screen;
  filter: brightness(1.3) contrast(1.15);
}

.card-overlay__image::after {
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, .9) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 42%, rgba(255, 255, 255, .62) 0 1px, transparent 2px),
    linear-gradient(125deg, rgba(255, 0, 132, .34), rgba(252, 164, 0, .22) 24%, rgba(255, 255, 0, .18) 36%, rgba(0, 255, 138, .22) 55%, rgba(0, 207, 255, .34) 72%, rgba(204, 76, 250, .32));
  background-size: 120px 120px, 180px 180px, 220% 220%;
  background-position: var(--mx) var(--my), var(--shine-x) var(--shine-y), var(--mx) var(--my);
  mix-blend-mode: color-dodge;
  filter: saturate(1.55) brightness(.95) contrast(1.2);
}

.card-overlay__image.foil-Gold::after {
  background:
    radial-gradient(circle at 25% 20%, rgba(255, 255, 255, .75) 0 1px, transparent 2px),
    linear-gradient(118deg, rgba(255, 255, 255, .12), rgba(251, 191, 36, .42) 24%, rgba(245, 158, 11, .2) 48%, rgba(255, 255, 255, .3) 56%, rgba(180, 83, 9, .28) 78%);
  background-size: 140px 140px, 220% 220%;
  background-position: var(--shine-x) var(--shine-y), var(--mx) var(--my);
  mix-blend-mode: color-dodge;
  filter: saturate(1.25) brightness(1.08) contrast(1.28);
}

.card-overlay__image.foil-Animated::after {
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, .95) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 44%, rgba(255, 255, 255, .7) 0 1px, transparent 2px),
    conic-gradient(from 90deg at var(--mx) var(--my), rgba(34, 211, 238, .42), rgba(244, 114, 182, .34), rgba(251, 191, 36, .32), rgba(45, 212, 191, .38), rgba(34, 211, 238, .42));
  background-size: 110px 110px, 170px 170px, 180% 180%;
  background-position: var(--mx) var(--my), var(--shine-x) var(--shine-y), center;
  mix-blend-mode: color-dodge;
  filter: saturate(1.8) brightness(1.05) contrast(1.2);
}

.card-overlay__image.is-active {
  box-shadow: 0 24px 44px rgba(0, 0, 0, .55), 0 0 28px rgba(56, 189, 248, .2);
}

.card-overlay__image.is-active::before {
  opacity: 0;
}

.card-overlay__image.is-active::after {
  opacity: 0;
}

.card-overlay__image.foil-Holographic.is-active::before {
  opacity: .64;
}

.card-overlay__image.foil-Holographic.is-active::after {
  opacity: .52;
}

.card-overlay__image.foil-Gold.is-active::before {
  opacity: .44;
}

.card-overlay__image.foil-Gold.is-active::after {
  opacity: .62;
}

.card-overlay__image.foil-Animated.is-active::before {
  opacity: .72;
}

.card-overlay__image.foil-Animated.is-active::after {
  opacity: .78;
}

.card-overlay__image img {
  display: block;
  width: 100%;
  background: #050914;
  transform: translateZ(22px);
  pointer-events: none;
}

.card-overlay__content {
  display: grid;
  gap: 14px;
  align-content: start;
  padding-top: 42px;
}

.card-overlay__content h2 {
  margin: 0;
  color: #f8fbff;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: .95;
  text-transform: uppercase;
}

.card-overlay__content p {
  margin: 0;
  color: #9cc9e7;
  font-size: 1.2rem;
  font-weight: 900;
}

.foil-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  border: 1px solid rgba(56, 189, 248, .28);
  color: #e0f2fe !important;
  background: rgba(8, 47, 73, .72);
  font-weight: 700;
}

.foil-Holographic::after,
.foil-Gold::after,
.foil-Animated::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .28;
  mix-blend-mode: screen;
}

.foil-Holographic::after {
  background: linear-gradient(115deg, transparent 20%, rgba(34, 211, 238, .6), rgba(244, 114, 182, .55), transparent 78%);
}

.foil-Gold {
  border-color: #d97706;
}

.foil-Gold::after {
  background: linear-gradient(115deg, transparent 22%, rgba(251, 191, 36, .75), transparent 72%);
}

.foil-Animated {
  border-color: #0f766e;
}

.foil-Animated::after {
  background: linear-gradient(115deg, transparent 18%, rgba(45, 212, 191, .65), rgba(251, 191, 36, .55), transparent 82%);
}

.rarity-Legendary {
  border-color: #f59e0b;
  box-shadow: inset 0 0 16px rgba(245, 158, 11, .15), 0 0 18px rgba(245, 158, 11, .16);
}

.rarity-Epic {
  border-color: #a855f7;
  box-shadow: inset 0 0 16px rgba(168, 85, 247, .12);
}

.rarity-Rare {
  border-color: #0ea5e9;
  box-shadow: inset 0 0 16px rgba(14, 165, 233, .16);
}

.beast-card.element-Fire {
  border-color: rgba(255, 59, 31, .72);
  box-shadow: inset 0 0 18px rgba(255, 59, 31, .14), 0 0 18px rgba(255, 59, 31, .11);
}

.beast-card.element-Water {
  border-color: rgba(0, 167, 255, .72);
  box-shadow: inset 0 0 18px rgba(0, 167, 255, .16), 0 0 18px rgba(0, 167, 255, .13);
}

.beast-card.element-Steel {
  border-color: rgba(168, 176, 184, .7);
  box-shadow: inset 0 0 18px rgba(168, 176, 184, .1), 0 0 18px rgba(168, 176, 184, .08);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 0;
  width: min(92vw, 1040px);
  transform: translateX(-50%);
  border: 1px solid rgba(56, 189, 248, .28);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(2, 6, 23, .94);
  box-shadow: inset 0 0 24px rgba(14, 165, 233, .1), 0 18px 38px rgba(0, 0, 0, .55);
}

.bottom-nav button {
  min-height: 68px;
  border: 0;
  border-right: 1px solid rgba(148, 163, 184, .16);
  border-radius: 0;
  background: transparent;
  color: #8a94a3;
  font-size: .98rem;
}

.bottom-nav button:last-child {
  border-right: 0;
}

.bottom-nav button.is-active {
  color: #38bdf8;
  background:
    linear-gradient(135deg, rgba(14, 165, 233, .24), transparent 42%),
    rgba(4, 15, 29, .88);
  box-shadow: inset 0 0 22px rgba(14, 165, 233, .28);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.offline-page {
  max-width: 560px;
  margin: 15vh auto;
  padding: 18px;
}

@media (min-width: 720px) {
  .app-shell {
    padding: 20px;
    padding-bottom: 118px;
  }

  .panel {
    padding: 20px;
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .brand {
    justify-self: end;
    font-size: clamp(1.55rem, 7vw, 2.4rem);
  }

  .icon-button {
    display: none;
  }

  .collection-header,
  .collection-layout {
    grid-template-columns: 1fr;
  }

  .view-toggle {
    justify-self: start;
  }

  .filter-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-rail h2,
  .filter-rail h3 {
    grid-column: 1 / -1;
  }

  .simple-battle-grid {
    grid-template-columns: 1fr;
  }

  .element-battle-button {
    min-height: 190px;
  }

  .element-battle-button img {
    width: 170px;
  }

  .card-overlay__panel {
    grid-template-columns: 1fr;
    width: min(100%, 560px);
  }

  .card-overlay__image {
    max-width: 360px;
    width: 100%;
    justify-self: center;
  }

  .card-overlay__content {
    padding-top: 0;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 10px 10px 104px;
  }

  .topbar {
    position: relative;
    grid-template-columns: 1fr;
    clip-path: none;
  }

  .brand {
    justify-self: start;
  }

  .avatar-mark {
    width: 46px;
    height: 46px;
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
    gap: 12px;
  }

  .xb-versus-bar,
  .xb-battle-stage,
  .battle-final__cards {
    grid-template-columns: 1fr;
  }

  .xb-combatant-opponent {
    text-align: left;
  }

  .xb-vs-mark,
  .xb-countdown {
    justify-self: center;
  }

  .bottom-nav {
    bottom: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: calc(100vw - 16px);
  }

  .bottom-nav button {
    min-height: 58px;
    padding: 0 6px;
    font-size: .72rem;
  }

  .card-overlay {
    padding: 10px;
  }

  .card-overlay__panel {
    padding: 12px;
  }

  .card-overlay__content h2 {
    font-size: 2rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .beast-card {
    transition: transform .18s ease, box-shadow .18s ease;
  }

  .beast-card:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 18px rgba(14, 165, 233, .18), 0 18px 30px rgba(0, 0, 0, .38);
  }

  .foil-Animated::after {
    animation: foil-sweep 3.5s linear infinite;
  }

  .is-revealed .xb-arena-card {
    animation: reveal-pop .34s ease-out both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card-overlay__image {
    transform: none;
    transition: none;
  }

  .card-overlay__image::before,
  .card-overlay__image::after {
    display: none;
  }
}

@keyframes foil-sweep {
  from {
    transform: translateX(-60%);
  }

  to {
    transform: translateX(60%);
  }
}

@keyframes reveal-pop {
  from {
    opacity: .4;
    transform: scale(.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}
