/* Brawl Stars style fonts: Russo One (Cyrillic+Latin) as BrawlStars, Lilita One fallback */
@font-face {
  font-family: "BrawlStars";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/BrawlStars-Cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "BrawlStars";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/BrawlStars-Latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Lilita One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/LilitaOne-Latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Lilita One";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/LilitaOne-LatinExt.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg0: #0a0512;
  --bg1: #140826;
  --bg2: #05020a;
  --card: rgba(28, 14, 52, 0.88);
  --yellow: #ffcc00;
  --green: #28a745;
  --blue: #2f6bff;
  --red: #dc3545;
  --text: #f5f0ff;
  --stroke: #000;
  --font-brawl: "BrawlStars", "Lilita One", "Nougat", sans-serif;
  --bs-outline: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--font-brawl);
  letter-spacing: 0.3px;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(107, 44, 255, 0.28), transparent 55%),
    radial-gradient(ellipse at 90% 20%, rgba(40, 10, 80, 0.45), transparent 40%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 45%, var(--bg2));
}
button, input, textarea, select {
  font-family: var(--font-brawl);
}
#stars {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.app {
  position: relative; z-index: 1;
  max-width: 480px; margin: 0 auto;
  padding: 14px 14px 100px;
}
.header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.brand {
  font-family: var(--font-brawl);
  font-weight: 400; font-size: 24px; letter-spacing: 1.2px;
  color: var(--yellow);
  text-shadow: var(--bs-outline), 0 0 18px rgba(255, 204, 0, 0.35);
  animation: brandPulse 2.8s ease-in-out infinite;
}
@keyframes brandPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}
.online { font-size: 12px; opacity: .9; margin-top: 4px; }
.badge-season {
  background: linear-gradient(135deg, #6b2cff, #9b59ff);
  border: 3px solid #000; box-shadow: 3px 3px 0 #000;
  border-radius: 999px; padding: 8px 10px; font-weight: 400; font-size: 12px;
  font-family: var(--font-brawl);
  text-shadow: var(--bs-outline);
}
.tabs { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.tab, .chip, .pay-btn, .btn, .card-btn, .cat-chip, .bottom-tab, .gem-card {
  border: 4px solid var(--stroke);
  box-shadow: 4px 4px 0 #000;
  font-family: var(--font-brawl);
  font-weight: 400; cursor: pointer;
}
.tab {
  flex: 1; min-width: 96px; background: #241342; color: #fff;
  padding: 11px 8px; border-radius: 14px;
  text-shadow: var(--bs-outline);
}
.tab.active { background: var(--yellow); color: #111; transform: translateY(-1px); text-shadow: none; }
.tab.hidden { display: none !important; }
.tab:active, .btn:active, .card-btn:active, .chip:active, .pay-btn:active,
.cat-chip:active, .bottom-tab:active, .gem-card:active {
  transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000;
}
.panel { display: none; }
.panel.active { display: block; animation: fade .28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none; } }
.product { transition: transform .18s ease; }
.product:hover { transform: translateY(-2px); }
.section-title {
  margin: 16px 0 10px; font-size: 15px; text-transform: uppercase;
  font-family: var(--font-brawl);
  text-shadow: var(--bs-outline); letter-spacing: .6px;
}
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-btn { background: #2a1850; color: #fff; padding: 14px; border-radius: 14px; text-shadow: var(--bs-outline); }
.pay-btn.active { background: var(--green); }

/* Category chips */
.cat-chips {
  display: flex; gap: 10px; margin: 14px 0 12px; flex-wrap: wrap;
}
.cat-chip {
  flex: 1; min-width: 140px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(180deg, #3a2068, #241342);
  color: #fff; padding: 12px 10px; border-radius: 16px;
  text-shadow: var(--bs-outline); font-size: 13px;
  text-transform: uppercase;
}
.cat-chip.active {
  background: linear-gradient(180deg, #ffdd44, #e6a800);
  color: #111; text-shadow: none;
}
.cat-chip-icon {
  width: 32px; height: 32px; object-fit: contain;
  filter: drop-shadow(2px 2px 0 #000);
}

.shop-block { display: none; }
.shop-block.active { display: block; }

/* Gem product cards — Brawl Stars donate style */
.gem-grid, .premium-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.gem-card {
  position: relative; display: block; width: 100%;
  padding: 0; border-radius: 18px; overflow: hidden;
  background: #168a32; text-align: center;
  min-height: 168px;
  transition: transform .15s ease;
}
.gem-card:hover { transform: translateY(-2px); }
.gem-card-rays {
  position: absolute; inset: 0; z-index: 0;
  background:
    repeating-conic-gradient(
      from 0deg at 50% 42%,
      rgba(255, 255, 255, 0.22) 0deg 12deg,
      transparent 12deg 24deg
    ),
    radial-gradient(circle at 50% 38%, #5ee87a 0%, #2db84d 38%, #1a8c32 62%, #0d5c22 100%);
}
.premium-rays {
  background:
    repeating-conic-gradient(
      from 0deg at 50% 42%,
      rgba(255, 220, 120, 0.28) 0deg 12deg,
      transparent 12deg 24deg
    ),
    radial-gradient(circle at 50% 38%, #c9a0ff 0%, #7b3fd4 40%, #4a1f8a 70%, #2a0d50 100%);
}
.gem-card.premium-card { background: #5a2d9e; }
.gem-card-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  align-items: center; min-height: 168px; padding: 8px 8px 36px;
}
.gem-card-head {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; margin-top: 4px;
}
.gem-card-label {
  font-size: 11px; letter-spacing: 0.8px;
  text-shadow: var(--bs-outline); color: #fff;
  line-height: 1.1;
}
.gem-card-amount {
  font-size: 28px; line-height: 1;
  color: #fff; text-shadow: var(--bs-outline);
}
.gem-card-amount-sm {
  font-size: 14px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; padding: 0 4px;
}
.premium-head .gem-card-label { color: #ffe566; }
.gem-card-art {
  flex: 1; display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 72px; margin: 4px 0;
}
.gem-card-art img {
  max-width: 88%; max-height: 78px;
  object-fit: contain;
  filter: drop-shadow(3px 3px 0 #000) drop-shadow(-1px -1px 0 rgba(0,0,0,.8));
}
.gem-art-lg img { max-height: 88px; }
.gem-art-xl img { max-height: 96px; transform: scale(1.08); }
.gem-card-price {
  position: absolute; bottom: 8px; right: 8px; z-index: 2;
  background: #111; color: #fff;
  padding: 6px 12px; border-radius: 12px;
  border: 3px solid #000;
  font-size: 15px; line-height: 1;
  text-shadow: var(--bs-outline);
  box-shadow: 2px 2px 0 rgba(0,0,0,.5);
}

/* Bottom navigation */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; gap: 10px; justify-content: center;
  max-width: 480px; margin: 0 auto;
  padding: 10px 14px 14px;
  background: linear-gradient(180deg, transparent, rgba(5, 2, 10, 0.92) 28%, #0a0512 100%);
}
.bottom-tab {
  flex: 1; max-width: 160px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: linear-gradient(180deg, #2a1850, #1a0f30);
  color: #fff; padding: 10px 8px 8px;
  border-radius: 16px;
  text-shadow: var(--bs-outline);
  font-size: 12px; text-transform: uppercase;
}
.bottom-tab.active {
  background: linear-gradient(180deg, #ffdd44, #d4a800);
  color: #111; text-shadow: none;
  transform: translateY(-2px);
}
.bottom-tab.hidden { display: none !important; }
.bottom-tab-icon {
  width: 36px; height: 32px; object-fit: contain;
  filter: drop-shadow(2px 2px 0 #000);
}
.bottom-tab.active .bottom-tab-icon { filter: none; }
.bottom-tab-emoji { font-size: 22px; line-height: 1; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card, .product, .stat, .account-row {
  background: var(--card);
  border: 4px solid #000;
  box-shadow: 4px 4px 0 #000;
  border-radius: 16px;
}
.card, .product { padding: 12px; }
.product .name {
  font-family: var(--font-brawl);
  font-weight: 400; font-size: 14px;
  text-shadow: var(--bs-outline);
}
.product .price {
  color: var(--yellow); font-size: 18px; margin: 8px 0;
  font-family: var(--font-brawl); font-weight: 400;
  text-shadow: var(--bs-outline);
}
.card-btn {
  width: 100%; background: var(--green); color: #fff; padding: 10px;
  border-radius: 12px; margin-top: 6px;
  text-shadow: var(--bs-outline);
  text-transform: uppercase;
}
.premium-card { grid-column: 1 / -1; }
.btn { width: 100%; padding: 12px; border-radius: 14px; margin-top: 8px; color: #111; }
.btn.green { background: var(--green); color: #fff; text-shadow: var(--bs-outline); }
.btn.yellow { background: var(--yellow); }
.btn.blue { background: var(--blue); color: #fff; text-shadow: var(--bs-outline); }
.btn.red { background: var(--red); color: #fff; text-shadow: var(--bs-outline); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bind-card label, .card label { display: block; margin: 8px 0 4px; font-size: 12px; opacity: .8; }
input, textarea {
  width: 100%; padding: 12px; border-radius: 12px; border: 3px solid #000;
  background: #0b0618; color: #fff; font-weight: 400; font-family: var(--font-brawl);
}
.accounts { display: flex; flex-direction: column; gap: 8px; }
.account-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px; gap: 8px;
}
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.stat span { font-size: 11px; opacity: .75; }
.stat b {
  font-size: 16px;
  font-family: var(--font-brawl);
  text-shadow: var(--bs-outline);
}
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
  background: #2a1850; color: #fff; padding: 8px 10px; border-radius: 12px; font-size: 12px;
}
.chip.active { background: var(--yellow); color: #111; }
.admin-pane { display: none; }
.admin-pane.active { display: block; }
.toggles { display: grid; gap: 8px; margin: 12px 0; }
.toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%);
  background: var(--yellow); color: #111; border: 3px solid #000;
  box-shadow: 4px 4px 0 #000; padding: 10px 14px; border-radius: 12px;
  font-family: var(--font-brawl); font-weight: 400; z-index: 30; max-width: 92%;
}
.toast.hidden, .hidden { display: none !important; }

/* Modals — Brawl Stars game style */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(5, 2, 10, 0.78);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: fade .2s ease;
}
.modal-backdrop.hidden { display: none !important; }
.modal {
  position: relative; width: 100%; max-width: 400px;
  border: 4px solid #000; border-radius: 20px;
  box-shadow: 6px 6px 0 #000;
  overflow: hidden;
  animation: modalPop .28s ease;
}
.modal.hidden { display: none !important; }
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: none; }
}
.modal-rays {
  position: absolute; inset: 0; z-index: 0;
  background:
    repeating-conic-gradient(
      from 0deg at 50% 30%,
      rgba(255, 255, 255, 0.2) 0deg 14deg,
      transparent 14deg 28deg
    ),
    radial-gradient(circle at 50% 25%, #5ee87a 0%, #2db84d 40%, #168a32 70%, #0d5c22 100%);
}
.payment-rays {
  background:
    repeating-conic-gradient(
      from 0deg at 50% 30%,
      rgba(255, 220, 100, 0.22) 0deg 14deg,
      transparent 14deg 28deg
    ),
    radial-gradient(circle at 50% 25%, #7b4fd4 0%, #4a28a0 45%, #2a0d50 100%);
}
.modal-body {
  position: relative; z-index: 1;
  padding: 18px 16px 16px;
  color: #fff;
}
.modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 36px; height: 36px; border-radius: 12px;
  border: 3px solid #000; box-shadow: 3px 3px 0 #000;
  background: #ffcc00; color: #111; font-size: 16px;
  font-family: var(--font-brawl); cursor: pointer;
}
.modal-product-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.modal-product-img {
  width: 72px; height: 64px; object-fit: contain;
  filter: drop-shadow(3px 3px 0 #000);
}
.modal-title {
  margin: 0; font-size: 20px; line-height: 1.15;
  text-shadow: var(--bs-outline);
  font-family: var(--font-brawl);
}
.modal-label {
  display: block; font-size: 12px; margin-bottom: 6px; opacity: 0.9;
}
.modal-tag-row {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 12px;
}
.modal-tag-fill {
  padding: 12px 10px; margin-top: 0; font-size: 11px;
  white-space: nowrap;
}
.modal-desc {
  font-size: 13px; line-height: 1.35; margin: 0 0 12px;
  opacity: 0.92; text-shadow: 1px 1px 0 #000;
}
.modal-total {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(0, 0, 0, 0.45); border: 3px solid #000;
  border-radius: 14px; padding: 10px 12px; margin-bottom: 12px;
  font-size: 15px;
}
.modal-total b {
  font-size: 22px; color: var(--yellow);
  text-shadow: var(--bs-outline);
}
.modal-pay-btn, .modal-bank-link {
  margin-top: 0; text-transform: uppercase;
}
.modal-bank-link {
  display: block; text-align: center; text-decoration: none;
  margin-bottom: 8px;
}
.payment-status {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 14px;
  border: 3px solid #000; box-shadow: 3px 3px 0 #000;
  margin-bottom: 12px; font-size: 15px;
  text-shadow: var(--bs-outline);
}
.payment-status.waiting { background: rgba(0, 0, 0, 0.5); }
.payment-status.success { background: #1e8c3a; }
.payment-status.error { background: #b91c1c; }
.modal-order-id {
  text-align: center; margin: 0 0 12px; font-size: 13px; opacity: 0.9;
}

@media (max-width: 380px) {
  .cards, .stats-grid, .gem-grid, .premium-grid { grid-template-columns: 1fr; }
  .gem-card-amount { font-size: 24px; }
}
