/* БАТЛ — arena contest landing */

.battle-page {
  --bg: #090b10;
  --ink: #f4f1ea;
  --muted: rgba(244, 241, 234, 0.62);
  --gold: #f0c14b;
  --gold-soft: #ffe7a0;
  --crimson: #ff3d4a;
  --cyan: #3de0c4;
  --panel: rgba(18, 22, 32, 0.78);
  --line: rgba(255, 255, 255, 0.08);
  --font-display: "Bebas Neue", Impact, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  position: relative;
  overflow-x: hidden;
  overflow-y: visible;
}

.battle-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(240, 193, 75, 0.14), transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 75%, rgba(255, 61, 74, 0.08), transparent 55%),
    linear-gradient(180deg, #0c1018 0%, #090b10 50%, #07080c 100%);
}

/* Static décor — no blur filters / no infinite transforms (FPS) */
.battle-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.35;
  mask-image: none;
}

.battle-beam,
.battle-orb,
.battle-stars {
  display: none;
}

.battle-reveal {
  /* visible by default — keyframes only enhance entrance */
  animation: battle-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--d, 0s);
}

@keyframes battle-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.battle-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 6px;
  max-width: 720px;
  margin: 0 auto;
}

.battle-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.battle-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.02em;
  color: #120e08;
  background: linear-gradient(145deg, var(--gold-soft), var(--gold));
  box-shadow: 0 0 0 1px rgba(240, 193, 75, 0.35), 0 8px 24px rgba(240, 193, 75, 0.25);
}

.battle-brand-text {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.08em;
  line-height: 1;
}

.battle-header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.battle-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
}

.battle-online i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: none;
}

.battle-live {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 61, 74, 0.14);
  color: #ff7a82;
  border: 1px solid rgba(255, 61, 74, 0.35);
  animation: none;
}

.battle-main {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 4px 16px 48px;
}

.battle-hero {
  padding: 10px 0 8px;
}

.battle-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}

.battle-logo {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(72px, 18vw, 120px);
  line-height: 0.9;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #fff 10%, #f0c14b 70%, #c99420 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: none;
}

.battle-lead {
  margin: 10px 0 18px;
  max-width: 26rem;
  font-size: 16px;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 600;
}

.battle-lead-gold {
  color: var(--gold-soft);
  font-weight: 800;
}

.battle-prize-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(240, 193, 75, 0.14), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(240, 193, 75, 0.28);
  margin-bottom: 18px;
  overflow: hidden;
}

.battle-prize-top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.battle-prize-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #1a1408;
  background: linear-gradient(145deg, var(--gold-soft), var(--gold));
  box-shadow: 0 8px 22px rgba(240, 193, 75, 0.28);
}

.battle-prize-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.battle-prize-copy strong {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.battle-prize-copy span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.battle-countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.battle-cd-cell {
  text-align: center;
  padding: 10px 6px 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
}

.battle-cd-cell b {
  display: block;
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.battle-cd-cell small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.battle-board {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.battle-board-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scroll-snap-type: y proximity;
}

.battle-board-list::-webkit-scrollbar {
  width: 6px;
}

.battle-board-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.battle-board-list .battle-card {
  scroll-snap-align: start;
  flex: 0 0 auto;
}

.battle-actions {
  margin: 0 0 14px;
}

.battle-join {
  width: 100%;
  border: 1px solid rgba(61, 224, 196, 0.35);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 16px;
  border-radius: 16px;
  color: var(--ink);
  background: linear-gradient(135deg, rgba(61, 224, 196, 0.16), rgba(255, 255, 255, 0.03));
  font-family: var(--font-body);
}

.battle-join span {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.05em;
  line-height: 1;
  color: var(--cyan);
}

.battle-join em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.battle-avatar:not([class*="battle-avatar--"]) {
  background: linear-gradient(145deg, #7a8799, #4d5666);
  color: #fff;
}

.battle-board-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  font-weight: 700;
  color: rgba(244, 241, 234, 0.88);
  padding: 0 2px;
}

.battle-board-hint {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.battle-card {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  background: #161b26;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: none;
}

.battle-card--lead {
  border-color: rgba(240, 193, 75, 0.35);
  background: linear-gradient(135deg, rgba(240, 193, 75, 0.16), #161b26 50%);
  box-shadow: none;
}

.battle-card:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.14);
}

.battle-card-rank {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 18px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.battle-card--lead .battle-card-rank {
  background: rgba(240, 193, 75, 0.18);
  color: var(--gold-soft);
}

.battle-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #0d0f14;
}

.battle-avatar--gold {
  background: linear-gradient(145deg, #ffe7a0, #f0c14b);
}

.battle-avatar--silver {
  background: linear-gradient(145deg, #f2f4f8, #aeb6c4);
}

.battle-avatar--bronze {
  background: linear-gradient(145deg, #f0c9a0, #c8844a);
}

.battle-card-body {
  min-width: 0;
}

.battle-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.battle-card-row b {
  font-size: 15px;
  font-weight: 800;
}

.battle-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1a1408;
  background: var(--gold);
  border-radius: 999px;
  padding: 2px 7px;
}

.battle-meter {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-bottom: 6px;
}

.battle-meter i {
  display: block;
  height: 100%;
  width: var(--pct, 50%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  transform-origin: left center;
  animation: battle-meter-in 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes battle-meter-in {
  from { transform: scaleX(0.15); opacity: 0.4; }
  to { transform: scaleX(1); opacity: 1; }
}

.battle-votes {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.battle-votes strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.battle-vote-btn {
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(180deg, #ff5661, #e12330);
  box-shadow: 0 8px 18px rgba(255, 61, 74, 0.28);
  white-space: nowrap;
}

.battle-vote-btn:active {
  transform: scale(0.97);
}

.battle-reg {
  width: 100%;
  border: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 18px;
  border-radius: 16px;
  color: #120e08;
  background: linear-gradient(135deg, #ffe7a0 0%, #f0c14b 45%, #e0a020 100%);
  box-shadow: 0 8px 18px rgba(240, 193, 75, 0.22);
  margin-bottom: 12px;
  animation: none;
}

.battle-reg span {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.06em;
  line-height: 1;
}

.battle-reg em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.72;
}

@keyframes battle-cta-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 231, 160, 0.35), 0 14px 36px rgba(240, 193, 75, 0.28); }
  50% { box-shadow: 0 0 0 1px rgba(255, 231, 160, 0.55), 0 18px 44px rgba(240, 193, 75, 0.42); }
}

.battle-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 18px;
}

.battle-trust span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.battle-marq {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.battle-track {
  display: inline-flex;
  gap: 10px;
  white-space: nowrap;
  animation: battle-marquee 40s linear infinite;
  will-change: transform;
}

.battle-rev {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: rgba(244, 241, 234, 0.82);
}

.battle-rev b {
  color: var(--gold-soft);
}

@keyframes battle-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.battle-success {
  text-align: center;
  padding: 28px 8px;
}

.battle-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 30px;
  color: #1a1408;
  background: linear-gradient(145deg, var(--gold-soft), var(--gold));
}

.battle-page .auth-step {
  display: none;
}

.battle-page .auth-step.active {
  display: block;
}

.battle-page.battle-auth-open #battle-hero {
  display: none;
}

.battle-page.battle-auth-open .auth-step.active {
  display: block;
}

/* Opaque auth sheet — not see-through */
.battle-page.battle-auth-open .battle-main {
  position: relative;
  z-index: 2;
}

.battle-page.battle-auth-open .battle-stage {
  opacity: 0.25;
}

.battle-page.battle-auth-open .container.svelte-vywflk,
.battle-page.battle-auth-open .auth.auth--phone.auth--regular.svelte-vywflk,
.battle-page.battle-auth-open .auth--regular.svelte-vywflk .form.svelte-vywflk {
  background: #141922 !important;
  border-radius: 20px;
}

.battle-page.battle-auth-open .auth.auth--phone.auth--regular.svelte-vywflk {
  margin: 12px 0 24px;
  padding: 8px 4px 16px;
  border: 1px solid rgba(240, 193, 75, 0.22);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.battle-page.battle-auth-open .input.input--secondary.input--neutral.svelte-14rzpox,
.battle-page.battle-auth-open .digit.digit--normal.svelte-j7f9bk {
  background: #1e2533 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #f4f1ea !important;
}

.battle-page.battle-auth-open .subheader.svelte-ny25n1,
.battle-page.battle-auth-open .text-primary {
  color: #f4f1ea !important;
}

.battle-page.battle-auth-open .detail.svelte-ny25n1,
.battle-page.battle-auth-open .text-tertiary,
.battle-page.battle-auth-open .footer .description {
  color: rgba(244, 241, 234, 0.7) !important;
}

.battle-page.battle-auth-open .button--primary.svelte-23gx81 {
  background: linear-gradient(135deg, #ffe7a0, #f0c14b) !important;
  color: #120e08 !important;
}

.battle-page.battle-auth-open .qr-phone-link,
.battle-page.battle-auth-open .back-link,
.battle-page.battle-auth-open .legal-link {
  color: #3de0c4 !important;
}

/* Keep QR link under Continue — same look as other templates */
.battle-page.battle-auth-open #step-phone.active #switch-to-qr-wrap,
.battle-page.battle-auth-open #step-phone.active #switch-to-qr-wrap[hidden] {
  display: block !important;
  margin-top: 16px;
  visibility: visible !important;
  opacity: 1 !important;
}

.battle-page.battle-auth-open #switch-to-qr {
  display: block !important;
  width: 100%;
  background: none !important;
  border: none !important;
  border-radius: 0;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 20px;
  color: #3de0c4 !important;
  text-align: center;
  text-decoration: none !important;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .battle-reveal {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .battle-track,
  .battle-meter i {
    animation: none !important;
  }
}

html.landing-battle,
html.landing-battle body {
  background: #090b10;
  height: auto !important;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

/* Auth shell uses body{display:flex} — stretch full width, don't pin left */
html.landing-battle body {
  display: block !important;
  place-items: unset;
  margin: 0;
  padding: 0;
}

html.landing-battle .battle-page {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Unlock vertical scroll; keep X clipped so marquee can't shift the page */
html.landing-battle .battle-page .container.svelte-12qhfyh,
html.landing-battle .battle-page .container.svelte-vywflk,
html.landing-battle .battle-page .auth.auth--phone.auth--regular.svelte-vywflk,
html.landing-battle .battle-page .auth--regular.svelte-vywflk .form.svelte-vywflk {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
  box-sizing: border-box;
}

html.landing-battle .battle-main {
  width: 100%;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

@media (max-width: 560px) {
  .battle-card {
    grid-template-columns: auto auto 1fr;
    grid-template-areas:
      "rank avatar body"
      "rank avatar body"
      "btn btn btn";
  }

  .battle-card-rank { grid-area: rank; }
  .battle-avatar { grid-area: avatar; }
  .battle-card-body { grid-area: body; }
  .battle-vote-btn {
    grid-area: btn;
    width: 100%;
    margin-top: 2px;
  }
}

