:root {
  color-scheme: dark;
  --bg: #171915;
  --bg-deep: #101210;
  --surface: #20231f;
  --surface-soft: #2a2e28;
  --text: #f4ead4;
  --muted: #aaa797;
  --accent: #c79a47;
  --accent-light: #f1d58c;
  --accent-dark: #7d5a24;
  --burgundy: #8b4348;
  --line: #4d4c42;
  --danger: #e17c76;
  --radius: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --gold: linear-gradient(135deg, #f7e3ad 0%, #c79a47 46%, #8a6626 100%);
  --hairline: rgba(199, 154, 71, 0.2);
  --hairline-strong: rgba(199, 154, 71, 0.42);
  --shadow-card: 0 20px 44px -24px rgba(0, 0, 0, 0.95);
  --shadow-lift: 0 10px 26px -14px rgba(199, 154, 71, 0.42);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  background: var(--bg);
}

body {
  position: relative;
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(199, 154, 71, 0.16), transparent 62%),
    radial-gradient(90% 50% at 100% 100%, rgba(139, 67, 72, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: max(9px, env(safe-area-inset-top)) 10px 9px;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 8px 22px rgba(8, 10, 8, 0.2);
}

.app-header::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.55;
}

.actionbar,
.header-tools,
.sheet-heading,
.card-meta {
  display: flex;
  align-items: center;
}

.actionbar {
  width: min(100%, 720px);
  margin-inline: auto;
  justify-content: space-between;
  direction: ltr;
  margin-top: 0;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.14em;
}

.app-brand span {
  background: var(--gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-mark {
  width: 13px;
  height: 13px;
  flex: none;
  border-radius: 3px;
  background: var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 12px rgba(199, 154, 71, 0.55);
}

.header-tools {
  gap: 7px;
}

.icon-button,
.language-button,
.balance {
  min-height: 38px;
  border: 1px solid #6a5b3f;
  border-radius: var(--radius);
  background: #242721;
  color: var(--text);
}

.icon-button,
.language-button {
  border-color: rgba(199, 154, 71, 0.34);
  background: linear-gradient(180deg, rgba(199, 154, 71, 0.14), rgba(199, 154, 71, 0.04));
  box-shadow: inset 0 1px 0 rgba(241, 213, 140, 0.12);
}

.icon-button,
.language-button,
.primary-button,
.card-cta {
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.icon-button:hover,
.language-button:hover {
  border-color: var(--accent);
  background: rgba(199, 154, 71, 0.2);
}

.icon-button:active,
.language-button:active,
.primary-button:active {
  transform: scale(0.98);
}

.icon-button:focus-visible,
.language-button:focus-visible,
.primary-button:focus-visible,
.category-card:focus-visible,
.search-mode:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

.icon-button {
  width: 38px;
  display: grid;
  place-items: center;
}

.icon-button.compact {
  width: 38px;
  min-height: 38px;
}

.icon-button svg,
.primary-button svg,
.card-cta svg,
.filter svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.language-button {
  width: 44px;
  color: var(--accent-light);
  font-size: 13px;
  font-weight: 850;
}

.balance {
  min-width: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border-color: #8c692e;
  background: linear-gradient(180deg, #74561f, #4f3a15);
  color: #f8e7bd;
  font-size: 16px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px 0 rgba(248, 231, 189, 0.24), 0 6px 16px -10px rgba(199, 154, 71, 0.9);
}

.balance {
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.balance:active {
  transform: scale(0.96);
}

.topup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.topup-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 54px;
  padding: 0 12px;
  border: 1px solid rgba(199, 154, 71, 0.34);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(199, 154, 71, 0.16), rgba(199, 154, 71, 0.04));
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}

.topup-option:active {
  transform: scale(0.97);
}

.topup-option[disabled] {
  opacity: 0.5;
  cursor: progress;
}

.topup-option svg {
  width: 18px;
  height: 18px;
  fill: var(--accent-light);
  stroke: #8c692e;
  stroke-width: 1;
}

.balance.is-bumped {
  animation: balance-bump 460ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

.balance svg {
  width: 19px;
  height: 19px;
  fill: var(--accent-light);
  stroke: #8c692e;
  stroke-width: 1;
  animation: star-breathe 2.8s ease-in-out infinite;
}

.filter {
  position: relative;
  width: min(100%, 720px);
  margin: 10px auto 0;
  padding-inline: 10px;
}

.filter svg {
  position: absolute;
  inset-inline-start: 22px;
  top: 50%;
  width: 17px;
  height: 17px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.filter input {
  width: 100%;
  min-height: 44px;
  padding-inline: 40px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: rgba(10, 12, 10, 0.55);
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.filter input::placeholder {
  color: var(--muted);
}

.filter input:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(199, 154, 71, 0.14);
  outline: none;
}

.catalog {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 8px 10px max(42px, env(safe-area-inset-bottom));
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 2px 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.catalog > .section-title:first-child {
  margin-top: 6px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--hairline-strong), transparent);
}

.section-title b {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.category-card {
  position: relative;
  width: 100%;
  display: block;
  overflow: hidden;
  margin: 0 0 14px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #23261f, #191c17);
  color: inherit;
  text-align: initial;
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px);
  box-shadow: var(--shadow-card);
  transition:
    opacity 420ms ease,
    border-color 200ms ease,
    box-shadow 260ms ease,
    transform 520ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.category-card:last-child {
  margin-bottom: 0;
}

.category-card.is-visible {
  opacity: 1;
  /* лёгкий дрейф всей карточки при скролле: раньше двигалась сама обложка,
     и её приходилось увеличивать, чтобы не показались края */
  transform: translate3d(0, calc(var(--card-shift, 0px) * -0.2), 0);
}

.card-art {
  position: relative;
  width: 100%;
  /* рамка одна на все карточки, обложка внутри вписывается целиком (contain):
     так карточки одного роста и ни у одной не срезает заголовок с флагом */
  aspect-ratio: 1.89 / 1;
  display: block;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
}

.card-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 62%, rgba(16, 18, 16, 0.55) 100%);
  pointer-events: none;
}

.card-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
  transition: filter 180ms ease;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid rgba(241, 213, 140, 0.34);
  border-radius: 999px;
  background: rgba(199, 154, 71, 0.14);
  color: var(--accent-light);
  direction: ltr;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.card-badge svg {
  width: 11px;
  height: 11px;
  fill: var(--accent-light);
  stroke: none;
}

.card-meta {
  min-height: 40px;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-top: 1px solid var(--hairline-strong);
  background: linear-gradient(180deg, rgba(199, 154, 71, 0.08), rgba(199, 154, 71, 0));
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.card-index {
  flex: none;
  align-self: stretch;
  display: grid;
  place-items: center;
  min-width: 30px;
  padding: 0 6px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(10, 12, 10, 0.45);
  color: var(--accent);
  direction: ltr;
  font-size: 11px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.card-text {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 5px;
}

.card-meta strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.card-cta {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(199, 154, 71, 0.34);
  border-radius: 10px;
  background: rgba(199, 154, 71, 0.12);
  color: var(--accent-light);
}

[dir="rtl"] .card-cta svg {
  transform: scaleX(-1);
}

.category-card:hover {
  border-color: rgba(199, 154, 71, 0.55);
  box-shadow: var(--shadow-card), var(--shadow-lift);
}

.category-card:hover .card-art img {
  filter: brightness(1.06);
}

.category-card:hover .card-cta {
  background: rgba(199, 154, 71, 0.24);
}

.category-card:active {
  transform: translateY(0) scale(0.992);
}

.category-card:focus-visible {
  border-radius: var(--radius-lg);
}

.loading {
  min-height: 40vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.skeleton {
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #23261f, #191c17);
}

.skeleton span {
  display: block;
  background: linear-gradient(90deg, rgba(199, 154, 71, 0.05) 25%, rgba(199, 154, 71, 0.13) 37%, rgba(199, 154, 71, 0.05) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.skeleton .skeleton-art {
  aspect-ratio: 1.89 / 1;
}

.skeleton .skeleton-bar {
  height: 14px;
  margin: 15px 13px;
  border-radius: 5px;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 44px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  opacity: 0.7;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(10, 12, 10, 0.68);
  backdrop-filter: blur(5px);
  animation: fade-in 200ms ease both;
}

.bottom-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 50;
  width: min(100%, 620px);
  max-height: min(86vh, 760px);
  overflow-y: auto;
  padding: 10px 20px max(22px, env(safe-area-inset-bottom));
  border: 1px solid var(--hairline-strong);
  border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background:
    radial-gradient(120% 40% at 50% 0%, rgba(199, 154, 71, 0.12), transparent 70%),
    var(--surface);
  color: var(--text);
  box-shadow: 0 -20px 60px rgba(9, 11, 9, 0.5);
  transform: translateX(-50%);
}

.bottom-sheet.is-opening {
  animation: sheet-in 280ms cubic-bezier(0.2, 0.78, 0.28, 1);
}

.bottom-sheet .icon-button {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--accent-light);
}

.sheet-handle {
  width: 44px;
  height: 4px;
  margin: 0 auto 18px;
  border-radius: 4px;
  background: #776d58;
}

.sheet-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.sheet-heading h1 {
  margin: 4px 0 0;
  font-size: 23px;
  line-height: 1.25;
}

.sheet-label {
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

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

.search-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.search-modes:empty {
  display: none;
}

.search-mode {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 12, 10, 0.5);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.search-mode:hover {
  border-color: rgba(199, 154, 71, 0.45);
  color: var(--text);
}

.search-mode[aria-selected="true"] {
  border-color: rgba(199, 154, 71, 0.7);
  background: linear-gradient(180deg, #5a4320, #3f2e15);
  color: var(--accent-light);
  box-shadow: inset 0 1px 0 rgba(241, 213, 140, 0.18), 0 6px 14px -8px rgba(199, 154, 71, 0.85);
}

.field {
  position: relative;
  display: grid;
  gap: 7px;
}

.field-hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.province-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}

.province-chip {
  min-height: 46px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 12, 10, 0.5);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.province-chip:hover {
  border-color: rgba(199, 154, 71, 0.5);
  color: var(--accent-light);
  background: rgba(90, 67, 32, 0.35);
}

.search-mode.is-province {
  border-color: rgba(199, 154, 71, 0.55);
  color: var(--accent-light);
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.field input {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid #645d4d;
  border-radius: 10px;
  background: #151713;
  color: var(--text);
  text-align: start;
  box-shadow: inset 0 1px 2px rgba(7, 8, 7, 0.28);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input:focus-visible {
  border-color: var(--accent);
  box-shadow: inset 0 1px 2px rgba(7, 8, 7, 0.28), 0 0 0 3px rgba(199, 154, 71, 0.14);
  outline: none;
}

.primary-button {
  position: relative;
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  border: 1px solid var(--accent-light);
  border-radius: 12px;
  background: var(--gold);
  color: #211807;
  font-weight: 850;
  box-shadow: 0 8px 20px rgba(12, 13, 11, 0.28), inset 0 1px 0 rgba(255, 249, 232, 0.5);
}

.primary-button:hover {
  box-shadow: 0 10px 28px -8px rgba(199, 154, 71, 0.6), inset 0 1px 0 rgba(255, 249, 232, 0.5);
}

.primary-button .cost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(33, 24, 7, 0.22);
  direction: ltr;
  font-size: 12px;
  font-weight: 850;
}

.primary-button .cost svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  stroke: none;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.primary-button.is-busy span {
  opacity: 0.7;
}

.results {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.results-head b {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.results-actions {
  display: flex;
  gap: 8px;
  margin-inline-start: auto;
}

.results-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(199, 154, 71, 0.08);
  color: var(--accent-light);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.results-action:hover {
  border-color: var(--accent);
  background: rgba(199, 154, 71, 0.2);
}

.results-action:disabled {
  cursor: wait;
  opacity: 0.6;
}

.results-action svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-row {
  position: relative;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface-soft), rgba(42, 46, 40, 0.6));
  animation: result-in 280ms ease both;
}

.result-row dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 14px;
  margin: 0;
}

.result-row dt {
  color: var(--muted);
}

.result-row dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* первой строке уступаем место под кнопку копирования карточки */
.result-row dd:first-of-type {
  padding-inline-end: 34px;
}

.result-row dd button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: start;
  cursor: pointer;
  transition: color 140ms ease;
}

.result-row dd button:hover {
  color: var(--accent-light);
}

/* кнопка копирования всей карточки — в дальнем от текста верхнем углу */
.card-copy {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 12, 10, 0.4);
  color: var(--muted);
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}

.card-copy:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

.card-copy svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.family-button {
  width: 100%;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid rgba(199, 154, 71, 0.45);
  border-radius: 10px;
  background: rgba(199, 154, 71, 0.12);
  color: var(--accent-light);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.family-button:hover {
  border-color: var(--accent);
  background: rgba(199, 154, 71, 0.22);
}

.family-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.result-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 26px 16px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

.result-empty svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  opacity: 0.75;
}

.referral-code {
  padding: 18px;
  border: 1px dashed var(--accent);
  border-radius: 12px;
  background: rgba(10, 12, 10, 0.5);
  color: var(--accent-light);
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  direction: ltr;
}

.referral-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 80;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  transform: translateX(-50%);
  box-shadow: 0 10px 30px rgba(8, 10, 8, 0.44);
  animation: toast-in 200ms ease both;
}

.toast.is-error {
  border-color: var(--danger);
  color: #f6cfcc;
}

[hidden] {
  display: none !important;
}

@media (max-width: 360px) {
  .app-brand {
    font-size: 14px;
  }

  .header-tools {
    gap: 5px;
  }

  .balance {
    min-width: 78px;
    padding-inline: 8px;
  }
}

@media (min-width: 760px) {
  .app-header {
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: 10px;
  }

  .catalog {
    padding-top: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .category-card {
    opacity: 1;
    transform: none;
  }
}

@keyframes star-breathe {
  0%,
  100% {
    filter: drop-shadow(0 0 0 rgba(241, 213, 140, 0));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 5px rgba(241, 213, 140, 0.35));
    transform: scale(1.07);
  }
}

@keyframes balance-bump {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.09);
    box-shadow: inset 0 1px 0 rgba(248, 231, 189, 0.24), 0 0 20px rgba(199, 154, 71, 0.55);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translate(-50%, 28px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.subscribe-gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
  background: rgba(10, 12, 10, 0.82);
  backdrop-filter: blur(7px);
  animation: fade-in 200ms ease both;
}

.subscribe-card {
  width: min(420px, 100%);
  padding: 26px 20px 22px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-deep) 100%);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.subscribe-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--gold);
  color: #211807;
}

.subscribe-mark svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.subscribe-card h1 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 850;
}

.subscribe-note {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.subscribe-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 20px;
}

.subscribe-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface-soft);
}

.subscribe-item.is-done {
  opacity: 0.5;
}

.subscribe-channel {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent-light);
  font-size: 14px;
  font-weight: 850;
}

.subscribe-done {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  color: #211807;
}

.subscribe-done svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.subscribe-card .primary-button {
  text-decoration: none;
}

.subscribe-card .primary-button.compact {
  width: auto;
  flex-shrink: 0;
  min-height: 34px;
  margin-top: 0;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 750;
  box-shadow: none;
}

.ghost-button {
  width: 100%;
  min-height: 46px;
  margin-top: 10px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.ghost-button:hover {
  border-color: var(--accent);
  color: var(--text);
}

.ghost-button:active {
  transform: scale(0.99);
}

.ghost-button:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

.ghost-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

body.is-locked {
  overflow: hidden;
}
