@font-face {
  font-family: "Corvetta Regular";
  src: url("../fonts/corvetta.woff2") format("woff2"),
       url("../fonts/corvetta.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "MullerNext";
  src: url("../fonts/MullerNext/MullerNextTrial-Regular.woff2") format("woff2"),
       url("../fonts/MullerNext/MullerNextTrial-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "MullerNext";
  src: url("../fonts/MullerNext/MullerNextTrial-RegularItalic.woff2") format("woff2"),
       url("../fonts/MullerNext/MullerNextTrial-RegularItalic.woff") format("woff");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "MullerNext";
  src: url("../fonts/MullerNext/MullerNextTrial-ExtraBold.woff2") format("woff2"),
       url("../fonts/MullerNext/MullerNextTrial-ExtraBold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fcebd9;       /* кремовый — база 1 */
  --ink: #1e1e1e;      /* графит — база 2 (текст) */
  --accent: #ff5e10;   /* оранжевый — акцент и обводка */
  --lilac: #cdabf5;    /* для крупных фоновых слов */
  --teal: #114e46;     /* вторичный акцент */

  --font-head: "Times New Roman", serif;
  --font-body: "MullerNext", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background: #e7e1db;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 422px;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
  position: relative;
}

/* Крупные фоновые слова, как в PDF */
.bg-word {
  position: absolute;
  z-index: 0;
  font-family: var(--font-head);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 0.9;
  opacity: 0.16;
  pointer-events: none;
  user-select: none;
}
.bg-word.w1 { top: 8%;  left: -10px;  font-size: 92px; color: var(--lilac); }
.bg-word.w2 { top: 38%; right: -18px; font-size: 70px; color: var(--teal); transform: rotate(8deg); }
.bg-word.w3 { bottom: 16%; left: -6px; font-size: 64px; color: var(--lilac); font-family: "Corvetta Regular", "Times New Roman", serif; }
.bg-word.w4 { bottom: 4%; right: -10px; font-size: 80px; color: var(--teal); transform: rotate(-6deg); font-family: "Corvetta Regular", "Times New Roman", serif; }

/* Header */
.app-header {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  padding: 8px 18px 6px;
  background: var(--bg);
  border-bottom: 2px solid var(--accent);
}
.brand {
  font-family: var(--font-head);
  font-size: 32px;
  line-height: 1;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink);
}
.brand .accent { color: var(--accent); }
.brand-logo { width: 200px; }
.brand-logo img { display: block; width: 100%; height: auto; }
.stat-chips { display: flex; gap: 8px; margin-top: 6px; }
.chip {
  flex: 1;
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  padding: 6px 4px;
  text-align: center;
}
.chip b {
  display: block;
  font-family: var(--font-head);
  font-size: 18px;
  line-height: 1;
  color: var(--accent);
}
.chip span { font-size: 10px; opacity: 0.8; }

/* Content */
.app-content {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 14px 18px;
  position: relative;
  z-index: 1;
}
.app-content::-webkit-scrollbar { width: 5px; }
.app-content::-webkit-scrollbar-thumb { background: rgba(255, 94, 16, 0.45); border-radius: 99px; }

.section { margin-bottom: 6px; }
.section-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink);
  margin: 2px 4px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::after {
  content: "";
  flex: 1; height: 2px;
  background: var(--accent);
  opacity: 0.5;
}
.empty { text-align: center; opacity: 0.6; padding: 30px 0; font-style: italic; }

.fade-in > * { animation: fadeUp 0.35s ease backwards; }
.fade-in > *:nth-child(2) { animation-delay: 0.04s; }
.fade-in > *:nth-child(3) { animation-delay: 0.08s; }
.fade-in > *:nth-child(4) { animation-delay: 0.12s; }
.fade-in > *:nth-child(n+5) { animation-delay: 0.16s; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Pills — контурные */
.points-pill, .price-pill {
  border: 1.5px solid var(--accent);
  color: var(--accent);
  background: transparent;
  font-weight: 700;
  font-size: 14px;
  padding: 3px 11px;
  border-radius: 99px;
  white-space: nowrap;
}
.price-pill { border-color: var(--teal); color: var(--teal); }
.points-pill small, .price-pill small { font-weight: 400; opacity: 0.8; font-size: 11px; }

/* Team cards — обводка акцентом */
.team-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 11px;
}
.team-medal {
  flex: 0 0 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 14px;
  border: 1.5px solid var(--ink); color: var(--ink);
}
.team-medal.m1 { border-color: var(--accent); color: var(--accent); }
.team-medal.m2 { border-color: var(--teal); color: var(--teal); }
.team-medal.m3 { border-color: var(--lilac); color: var(--teal); }
.team-ava {
  flex: 0 0 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 15px;
  text-transform: uppercase;
  background: var(--accent); color: #fff;
}
.team-main { flex: 1 1 auto; min-width: 0; }
.team-name { font-weight: 700; font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 8px; border-radius: 99px; border: 1px solid var(--accent); background: transparent; overflow: hidden; margin-top: 7px; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 99px; }

/* Participant rows */
.user-row {
  display: flex; align-items: center; gap: 10px;
  background: #fff;
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  padding: 9px 12px;
  margin-bottom: 9px;
}
.rank {
  flex: 0 0 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 12px;
  border: 1.5px solid var(--ink); color: var(--ink);
}
.rank.m1 { border-color: var(--accent); color: var(--accent); }
.rank.m2 { border-color: var(--teal); color: var(--teal); }
.rank.m3 { border-color: var(--lilac); color: var(--teal); }
.avatar {
  flex: 0 0 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 14px;
  text-transform: uppercase;
  background: var(--accent); color: #fff;
}
.user-meta { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.user-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-team { font-size: 11px; font-style: italic; opacity: 0.8; }
.user-mini { height: 4px; border-radius: 99px; margin-top: 5px; border: 1px solid var(--accent); overflow: hidden; }
.user-mini > i { display: block; height: 100%; background: var(--accent); }

/* Shop */
.balance-bar {
  display: flex; align-items: baseline; gap: 6px;
  font-family: var(--font-body); font-size: 14px; font-weight: 700;
  color: var(--ink); margin: 0 0 12px;
}
.balance-bar b { color: var(--accent); font-family: var(--font-head); font-size: 19px; }
.shop-grid { display: block; }
.shop-card {
  position: relative; overflow: hidden;
  background: #fff; border: 1.5px solid var(--accent); border-radius: 14px;
  display: flex; flex-direction: column; margin-bottom: 12px;
}
.shop-img {
  height: 90px; display: grid; place-items: center;
  background: var(--lilac); position: relative;
}
.shop-img img { width: 100%; height: 100%; object-fit: cover; }
.shop-img::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 11px; background: #fff;
  clip-path: polygon(0 100%, 0 30%, 7% 72%, 14% 22%, 21% 70%, 28% 26%, 35% 70%, 42% 22%, 49% 70%, 56% 26%, 63% 70%, 70% 22%, 77% 70%, 84% 26%, 91% 70%, 100% 30%, 100% 100%);
}
.shop-emoji { font-size: 40px; }
.ribbon {
  position: absolute; top: 8px; left: 8px;
  background: var(--accent); color: #fff;
  font-family: var(--font-body); font-size: 9px; font-weight: 700; letter-spacing: 1px;
  padding: 2px 8px; border-radius: 99px;
}
.shop-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.shop-name { font-family: var(--font-head); font-size: 18px; line-height: 1.05; }
.badge-cat {
  align-self: flex-start;
  border: 1.4px solid var(--teal); color: var(--teal);
  border-radius: 99px; padding: 1px 9px; font-size: 10px; font-weight: 700;
}
.shop-desc { font-size: 12px; line-height: 1.3; color: #4a4a4a; }
.shop-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.price-pill {
  border: 1.4px solid var(--ink); border-radius: 99px;
  padding: 3px 12px; font-weight: 700; font-size: 13px;
}
.btn-buy {
  border: 1.4px solid var(--accent); color: var(--accent); background: #fff;
  border-radius: 99px; padding: 5px 16px; font-weight: 700; font-size: 12px; cursor: pointer;
}
.btn-buy:hover { background: var(--accent); color: #fff; }

/* Modals — Apple-style */
.modal-overlay {
  position: absolute; inset: 0; z-index: 50;
  display: none; align-items: center; justify-content: center;
  background: rgba(30,30,30,0.45);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  padding: 24px;
}
.modal-overlay.show { display: flex; }
.modal-card {
  width: 100%; max-width: 320px;
  background: #fff; border-radius: 18px;
  padding: 22px 20px 16px; text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  animation: modal-pop .22s ease;
}
@keyframes modal-pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-title { font-family: var(--font-head); font-size: 20px; color: var(--ink); margin-bottom: 8px; }
.modal-text { font-family: var(--font-body); font-size: 14px; color: #4a4a4a; line-height: 1.4; margin-bottom: 18px; }
.modal-text b { color: var(--accent); }
.modal-actions { display: flex; gap: 10px; }
.modal-btn {
  flex: 1 1 0; border: none; border-radius: 99px;
  padding: 11px 0; font-family: var(--font-body); font-size: 14px; font-weight: 700; cursor: pointer;
}
.modal-btn.ghost { background: rgba(30,30,30,0.06); color: var(--ink); }
.modal-btn.primary { background: var(--accent); color: #fff; }

/* Categories — тот же сегментированный стиль, что у разделов */
.cat-bar {
  display: flex; gap: 4px;
  margin: 0 0 14px; padding: 4px;
  background: rgba(30,30,30,0.06);
  border-radius: 99px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.cat-chip {
  flex: 1 1 0;
  border: none; background: transparent;
  color: var(--ink); font-family: var(--font-body); font-size: 13px; font-weight: 700;
  cursor: pointer; padding: 8px 6px; border-radius: 99px;
  text-align: center; white-space: nowrap;
  opacity: 0.55;
  transition: background .22s ease, opacity .22s ease, color .22s ease, box-shadow .22s ease;
}
.cat-chip.active {
  opacity: 1; background: #fff; color: var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,0.14);
}
.sec-bar {
  display: flex; gap: 4px;
  margin: 10px 14px 16px; padding: 4px;
  background: rgba(30,30,30,0.06);
  border-radius: 99px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.sec-chip {
  flex: 1 1 0;
  border: none; background: transparent;
  color: var(--ink); font-family: var(--font-body); font-size: 14px; font-weight: 700;
  cursor: pointer; padding: 9px 8px; border-radius: 99px;
  text-align: center; white-space: nowrap;
  opacity: 0.55;
  transition: background .22s ease, opacity .22s ease, color .22s ease, box-shadow .22s ease;
}
.sec-chip.active {
  opacity: 1; background: #fff; color: var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,0.14);
}
.cat-badge {
  align-self: flex-start;
  font-size: 10px; font-weight: 700; font-style: italic;
  color: var(--teal); border: 1px solid var(--teal);
  padding: 1px 7px; border-radius: 99px;
}


/* Spotlight — выделенная карточка лидера (толще обводка) */
.spotlight {
  position: relative;
  border: 2.5px solid var(--accent);
  border-radius: 14px;
  padding: 15px 16px;
  margin-bottom: 14px;
  background: #fff;
}
.spot-label {
  font-family: var(--font-head); font-size: 13px; text-transform: uppercase;
  letter-spacing: 1px; color: var(--accent);
}
.spot-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.spot-ava {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 20px;
  text-transform: uppercase; background: var(--accent); color: #fff; flex: 0 0 auto;
}
.spot-name { font-family: var(--font-body); font-weight: 700; font-size: 21px; line-height: 1.1; letter-spacing: 0.2px; color: var(--ink); }
.spot-sub { font-size: 12px; font-style: italic; opacity: 0.8; margin-top: 3px; }
.spot-crown { position: absolute; top: 10px; right: 14px; font-size: 24px; }
.spot-points {
  margin-left: auto; font-family: var(--font-head); font-size: 24px; color: var(--accent); text-align: right;
}
.spot-points small { font-size: 12px; font-weight: 400; opacity: 0.8; font-family: var(--font-body); }

/* Brand quote */
.brand-quote {
  position: relative;
  background: #fff;
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 14px 16px 12px 44px;
  margin-bottom: 14px;
}
.brand-quote::before {
  content: "\201C"; position: absolute; left: 12px; top: -6px;
  font-family: var(--font-head); font-size: 60px; line-height: 1; color: var(--accent); opacity: 0.5;
}
.brand-quote .q-text { font-style: italic; font-size: 15px; line-height: 1.3; color: var(--ink); }
.brand-quote .q-author { margin-top: 8px; text-align: right; font-size: 12px; font-weight: 700; }
