/* Знижколов — стилі.
   Ідея оформлення: «цінник». Акцентний бурштиновий колір цінника, чорнильно-синій фон,
   великі ціни, знижки — зеленим. Світла й темна теми задаються токенами нижче. */

:root {
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #eaeef5;
  --border: #d8deea;
  --fg: #121826;
  --muted: #5a6478;
  --accent: #f29a2e;
  --accent-strong: #c46f05;
  --on-accent: #1f1304;
  --good: #137a39;
  --good-bg: #dcf4e3;
  --warn: #a35104;
  --danger: #c62828;
  --danger-bg: #fdeaea;
  --steam: #1f6fb2;
  --gog: #8a3fd1;
  --epic: #3a4252;
  /* Лінії графіка: синій і помаранчевий розрізняються і при дальтонізмі
     (фірмові синій Steam і фіолетовий GOG — ні) */
  --chart-steam: #1f6fb2;
  --chart-gog: #c2410c;
  --chart-keys: #0f8a6c;
  --keys: #0f8a6c;
  --shadow: 0 1px 2px rgb(18 24 38 / 0.05), 0 6px 20px rgb(18 24 38 / 0.06);
  --ring: 0 0 0 3px rgb(242 154 46 / 0.45);

  --font-display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  /* «Матове скло» для великих блоків: крізь них трохи видно фон із грою */
  --glass: color-mix(in srgb, var(--surface) 76%, transparent);
  --glass-blur: blur(18px) saturate(1.4);
  --radius: 14px;
  --radius-sm: 9px;
  --topbar-h: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0c111d;
    --surface: #141b2b;
    --surface-2: #1b2437;
    --border: #263149;
    --fg: #e6eaf2;
    --muted: #93a0b9;
    --accent: #f5a53f;
    --accent-strong: #ffbb63;
    --on-accent: #1f1304;
    --good: #4ade80;
    --good-bg: rgb(74 222 128 / 0.13);
    --warn: #fbbf24;
    --danger: #f87171;
    --danger-bg: rgb(248 113 113 / 0.12);
    --steam: #66b3f0;
    --gog: #c08af0;
    --epic: #c9d1e0;
  --chart-steam: #3d8ce6;
  --chart-gog: #e0662f;
  --chart-keys: #2fbf95;
  --keys: #2fbf95;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px rgb(0 0 0 / 0.22);
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #0c111d;
  --surface: #141b2b;
  --surface-2: #1b2437;
  --border: #263149;
  --fg: #e6eaf2;
  --muted: #93a0b9;
  --accent: #f5a53f;
  --accent-strong: #ffbb63;
  --on-accent: #1f1304;
  --good: #4ade80;
  --good-bg: rgb(74 222 128 / 0.13);
  --warn: #fbbf24;
  --danger: #f87171;
  --danger-bg: rgb(248 113 113 / 0.12);
  --steam: #66b3f0;
  --gog: #c08af0;
  --epic: #c9d1e0;
  --chart-steam: #3d8ce6;
  --chart-gog: #e0662f;
  --chart-keys: #2fbf95;
  --keys: #2fbf95;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px rgb(0 0 0 / 0.22);
  color-scheme: dark;
}

/* ---------- База ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3 {
  margin: 0;
  text-wrap: balance;
  line-height: 1.2;
}

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.1rem;
  font-weight: 800;
}

p {
  margin: 0;
}

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: 6px;
}

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

.num {
  font-variant-numeric: tabular-nums;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Верхня панель ---------- */
.verify-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.verify-banner[hidden] {
  display: none;
}

.verify-banner .icon-btn {
  width: 30px;
  height: 30px;
  font-size: 18px;
}

.outbox {
  display: grid;
  gap: 8px;
}

.outbox-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.outbox-item summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  cursor: pointer;
}

.outbox-item .row {
  margin: 10px 0;
}

.outbox-preview {
  width: 100%;
  height: 460px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f2f4f8;
}

.auth-narrow {
  grid-template-columns: minmax(0, 440px);
  justify-content: center;
}

.lang-btn {
  width: auto;
  min-width: 38px;
  padding: 0 8px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
}

@media (max-width: 420px) {
  /* На вузьких телефонах від логотипа лишається значок — інакше кнопки шапки не вміщаються */
  .brand-name {
    display: none;
  }
  .topbar-actions {
    gap: 6px;
  }
}

.offline-banner {
  background: var(--fg);
  color: var(--bg);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
}

.offline-banner[hidden] {
  display: none;
}

.btn-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#install-btn {
  gap: 6px;
}

#install-btn[hidden] {
  display: none;
}

@media (max-width: 1280px) {
  /* На ноутбуках і телефонах лишаємо тільки значок, щоб шапка з меню вміщалась */
  #install-btn span {
    display: none;
  }
}

.demo-banner {
  background: var(--accent);
  color: var(--on-accent);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--topbar-h);
  padding: env(safe-area-inset-top, 0px) 16px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
}

.brand-tag {
  fill: var(--accent);
}

.brand-hole {
  fill: var(--bg);
}

.brand-sign {
  fill: var(--on-accent);
}

.brand-slash {
  stroke: var(--on-accent);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--fg);
  background: var(--surface-2);
}

.nav a.active {
  color: var(--fg);
  background: var(--surface-2);
}

.nav svg,
.icon-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-count {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  line-height: 19px;
  text-align: center;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  color: var(--fg);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-2);
}

.icon-moon {
  display: none;
}

:root[data-theme='dark'] .icon-sun {
  display: none;
}

:root[data-theme='dark'] .icon-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .icon-sun {
    display: none;
  }
  :root:not([data-theme='light']) .icon-moon {
    display: block;
  }
}

.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  text-decoration: none;
}

.avatar.active {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

.avatar {
  overflow: hidden;
}

.avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Зона перетягування файлу ---------- */
.dropzone {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 20px 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--fg);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.dropzone:hover,
.dropzone.dragging {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-2));
}

.dropzone:focus-within {
  box-shadow: var(--ring);
}

.dropzone.busy {
  cursor: progress;
  opacity: 0.75;
  pointer-events: none;
}

.dropzone-icon {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--accent-strong);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dropzone-hint {
  color: var(--muted);
  font-size: 13px;
}

.dropzone-error {
  margin-top: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.dropzone-error[hidden] {
  display: none;
}

/* ---------- Таблиця, складена вручну ---------- */
.segmented.tabs {
  flex-wrap: wrap;
  justify-self: start;
}

.lookup-rows {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
  padding: 2px;
}

.lookup-row {
  display: grid;
  grid-template-columns: 26px 1fr 38px;
  gap: 8px;
  align-items: center;
}

.lookup-num {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.lookup-row .icon-btn {
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
}

/* ---------- Звіт імпорту ---------- */
.report-list {
  display: grid;
  gap: 6px;
  max-height: 260px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
  font-size: 14px;
}

.report-list li {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 8px;
}

.report-line {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.7;
}

.report-note {
  display: block;
}

/* ---------- Розмітка сторінок ---------- */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: 28px 64px;
}

.container:focus {
  outline: none;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 22px;
}

.page-head p {
  margin-top: 6px;
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 14px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 30px 0 14px;
}

.section-title .count {
  color: var(--muted);
  font-weight: 600;
}

.panel {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  color: var(--fg);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn:hover {
  background: var(--surface-2);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--on-accent);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, #fff);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--fg);
}

.btn-danger {
  color: var(--danger);
}

.btn-danger.solid {
  background: var(--danger);
  border-color: transparent;
  color: #fff;
}

.btn-sm {
  min-height: 32px;
  padding: 0 11px;
  font-size: 13px;
  border-radius: 8px;
}

.btn[disabled],
.btn.loading {
  opacity: 0.6;
  pointer-events: none;
}

.btn.loading::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Форми ---------- */
.field {
  display: grid;
  gap: 6px;
}

.field label,
.label {
  font-weight: 700;
  font-size: 13px;
}

.input,
.select {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
}

/* Власна стрілка списку замість системної — однакова в усіх браузерах і темах */
.select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a94a8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  cursor: pointer;
}

/* Chrome і Edge (135+) дозволяють оформити й сам список варіантів. Інші браузери показують системний. */
@supports (appearance: base-select) {
  .select,
  .select::picker(select) {
    appearance: base-select;
  }

  .select {
    display: inline-flex;
    align-items: center;
  }

  /* Стрілка — наша, з фону поля; при відкритті розвертається */
  .select::picker-icon {
    display: none;
  }

  .select:open {
    border-color: var(--accent);
    box-shadow: var(--ring);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f29a2e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 15 6-6 6 6'/%3E%3C/svg%3E");
  }

  .select::picker(select) {
    margin-block: 6px;
    padding: 5px;
    max-height: min(380px, 60vh);
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--fg);
    box-shadow: 0 16px 40px rgb(0 0 0 / 0.28);
    opacity: 0;
    translate: 0 -4px;
    transition: opacity 0.15s, translate 0.15s, overlay 0.15s allow-discrete, display 0.15s allow-discrete;
  }

  .select:open::picker(select) {
    opacity: 1;
    translate: 0 0;
  }

  @starting-style {
    .select:open::picker(select) {
      opacity: 0;
      translate: 0 -4px;
    }
  }

  .select option {
    gap: 8px;
    padding: 8px 12px 8px 8px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
  }

  .select option:hover,
  .select option:focus-visible {
    outline: none;
    background: var(--surface-2);
  }

  .select option:checked {
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    color: var(--accent-strong);
  }

  .select option::checkmark {
    color: var(--accent);
    font-weight: 800;
  }

  .select option:disabled {
    opacity: 0.4;
    cursor: default;
    background: none;
  }
}

.input:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.input.invalid {
  border-color: var(--danger);
}

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

.hint {
  color: var(--muted);
  font-size: 13px;
}

.input-suffix {
  position: relative;
}

.input-suffix .input {
  padding-right: 40px;
}

.input-suffix span {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 700;
  pointer-events: none;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-weight: 600;
}

.check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.form-error {
  padding: 10px 13px;
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 600;
  font-size: 14px;
}

/* Перемикач магазинів / вкладок */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.segmented button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.segmented button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow);
}

/* ---------- Магазини, ціни, статуси ---------- */
.store {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 13px;
}

.store::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--store-color, var(--muted));
}

.store-steam {
  --store-color: var(--steam);
}

.store-gog {
  --store-color: var(--gog);
}

.store-epic {
  --store-color: var(--epic);
}

.store-keys {
  --store-color: var(--keys);
}

.price {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.price-old {
  color: var(--muted);
  text-decoration: line-through;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.discount {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--good-bg);
  color: var(--good);
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--muted);
}

.pill-good {
  background: var(--good-bg);
  color: var(--good);
}

.pill-accent {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent-strong);
}

.pill-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ---------- Картка гри у списку ---------- */
.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-head .summary {
  margin-top: 10px;
}

.game-list {
  display: grid;
  gap: 12px;
}

.game-card {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr) minmax(250px, 320px);
  gap: 18px;
  align-items: start;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.game-card.met {
  border-color: color-mix(in srgb, var(--good) 45%, var(--border));
}

.game-card.paused {
  opacity: 0.72;
}

.cover {
  width: 100%;
  aspect-ratio: 231 / 87;
  max-width: 100%;
  border-radius: 9px;
  object-fit: cover;
  background: var(--surface-2);
}

.cover-placeholder {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--muted);
  background: linear-gradient(135deg, var(--surface-2), color-mix(in srgb, var(--accent) 16%, var(--surface-2)));
}

.game-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.game-title {
  font-size: 17px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.conditions {
  color: var(--muted);
  font-size: 13.5px;
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.prices {
  display: grid;
  gap: 2px;
  padding: 6px;
  border-radius: 11px;
  background: var(--surface-2);
}

.price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
  padding: 7px 9px;
  border-radius: 8px;
  text-decoration: none;
}

.price-row:hover {
  background: var(--surface);
}

.price-row.best {
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.price-values {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.price-note {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--muted);
}

.best-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-strong);
}

.checked-at {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 9px 2px;
}

/* ---------- Пошук ---------- */
.search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.search-bar .input {
  min-height: 50px;
  font-size: 16px;
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.result-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 10px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.result-card h3 {
  font-size: 15px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.result-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Порожні стани ---------- */
.empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 48px 20px;
  text-align: center;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty p {
  max-width: 46ch;
  color: var(--muted);
}

.empty-icon {
  width: 56px;
  height: 56px;
}

/* ---------- Роздачі Epic ---------- */
.freebies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.freebie {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.freebie .cover {
  aspect-ratio: 16 / 9;
}

.freebie-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Сповіщення ---------- */
.notice-list {
  display: grid;
  gap: 8px;
}

.notice {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.notice.unread {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border));
}

.notice-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 19px;
}

.notice-title {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.notice-body {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}

.notice-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- Профіль ---------- */
.ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
}

.profile-cover {
  position: relative;
  overflow: hidden;
  height: 150px;
  background:
    radial-gradient(110% 150% at 0% 0%, rgb(245 165 63 / 0.55), transparent 60%),
    radial-gradient(80% 130% at 100% 0%, rgb(192 138 240 / 0.4), transparent 65%),
    linear-gradient(135deg, #1b2437, #0c111d);
}

/* Обкладинки ігор зі списку: притемнені, щоб фото профілю на їхньому тлі добре виднілося */
.profile-covers {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
}

.profile-covers img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  filter: blur(3px) saturate(1.3);
  transform: scale(1.08);
}

.profile-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(12 17 29 / 0.15), rgb(12 17 29 / 0.65));
}

.profile-id {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 0 24px 20px;
}

.profile-avatar {
  position: relative;
  flex-shrink: 0;
  width: 128px;
  height: 128px;
  margin-top: -58px;
  border: 5px solid var(--surface);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.profile-avatar-img {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  transition: filter 0.15s;
}

.profile-avatar:hover .profile-avatar-img {
  filter: brightness(0.82);
}

.profile-avatar:focus-within {
  box-shadow: var(--ring);
}

.profile-avatar-badge {
  position: absolute;
  right: 0;
  bottom: 2px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
}

.profile-avatar-badge .ico {
  width: 17px;
  height: 17px;
}

/* Поки фото завантажується — крутилка поверх нього */
.profile-hero.busy .profile-avatar-img {
  filter: brightness(0.6);
}

.profile-hero.busy .profile-avatar::after {
  content: '';
  position: absolute;
  inset: 38%;
  border: 3px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.profile-who {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
  padding-top: 16px;
}

.profile-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.profile-name h1 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  overflow-wrap: anywhere;
}

.profile-email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.profile-who .muted {
  font-size: 14px;
}

.profile-logout {
  margin-top: 16px;
}

/* Перетягування картинки на шапку */
.profile-hero.dragging {
  outline: 2px dashed var(--accent);
  outline-offset: -8px;
}

.profile-drop-hint {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  place-items: center;
  padding: 16px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  font-weight: 800;
  font-size: 18px;
  text-align: center;
  pointer-events: none;
}

.profile-hero.dragging .profile-drop-hint {
  display: grid;
}

.profile-drop-error {
  display: block;
  margin: -6px 24px 16px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
}

.profile-stat {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 16px 24px;
  border-left: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s;
}

.profile-stat:first-child {
  border-left: 0;
}

a.profile-stat:hover {
  background: var(--surface-2);
}

.profile-stat b {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
}

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

.profile-stat em {
  font-style: normal;
  color: var(--accent-strong);
}

.profile-stat.is-good b {
  color: var(--good);
}

.profile-stat.is-accent b {
  color: var(--accent-strong);
}

.profile-stat.skeleton {
  height: 78px;
  border-radius: 0;
}

/* Вкладки зліва, вміст справа */
.profile-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.profile-tabs {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  display: grid;
  gap: 4px;
}

.profile-tabs button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.profile-tabs button:hover {
  background: var(--surface-2);
  color: var(--fg);
}

.profile-tabs button[aria-selected='true'] {
  background: var(--surface);
  border-color: var(--border);
  color: var(--fg);
  box-shadow: var(--shadow);
}

.profile-tabs button[aria-selected='true'] .ico {
  color: var(--accent);
}

.profile-tabs .ico {
  width: 20px;
  height: 20px;
}

.profile-panel {
  display: grid;
  gap: 16px;
}

.profile-panel .segmented {
  justify-self: start;
}

.profile-panel-pair {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
}

.panel-head {
  display: grid;
  gap: 4px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.input-with-action {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-with-action .input {
  flex: 1;
  min-width: 0;
}

.pill-warn {
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  color: var(--warn);
}

/* Канали сповіщень: сайт, Telegram, пошта */
.channels {
  display: grid;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.channel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.channel:first-child {
  border-top: 0;
}

.channel-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--fg);
}

.channel-icon .ico {
  width: 20px;
  height: 20px;
}

.channel-icon.is-telegram {
  background: rgb(42 171 238 / 0.16);
  color: #2aabee;
}

.channel-text {
  display: grid;
  gap: 4px;
}

.channel-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.channel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* Перемикач «увімкнено / вимкнено» — звичайний checkbox, лише інакше намальований */
.switch {
  display: inline-flex;
  padding-top: 8px;
  cursor: pointer;
}

.switch input {
  position: relative;
  width: 46px;
  height: 26px;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  appearance: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.switch input::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s, background 0.2s;
}

.switch input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.switch input:checked::before {
  transform: translateX(20px);
  background: var(--on-accent);
}

.switch input:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

.switch input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Підключення Telegram: QR-код і команда для бота */
.tg-connect {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 8px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-2);
}

.tg-connect .tg-code {
  background: var(--surface);
}

.tg-qr {
  flex-shrink: 0;
  padding: 6px;
  border-radius: 10px;
  background: #fff;
}

.dot-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
  animation: dot-pulse 1.2s infinite ease-in-out;
}

@keyframes dot-pulse {
  50% {
    opacity: 0.25;
    transform: scale(0.7);
  }
}

@media (max-width: 760px) {
  .profile-cover {
    height: 110px;
  }
  .profile-id {
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 0 16px 16px;
  }
  .profile-avatar {
    width: 100px;
    height: 100px;
    margin-top: -46px;
  }
  .profile-avatar-img {
    font-size: 38px;
  }
  .profile-logout {
    order: 1;
    margin: 12px 0 0 auto;
  }
  .profile-who {
    order: 2;
    flex-basis: 100%;
    padding-top: 0;
  }
  .profile-drop-error {
    margin: -4px 16px 14px;
  }
  .profile-stats {
    grid-template-columns: 1fr 1fr;
  }
  .profile-stat {
    padding: 12px 16px;
  }
  .profile-stat:nth-child(3) {
    border-left: 0;
  }
  .profile-stat:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }
  .profile-stat b {
    font-size: 20px;
  }
  .profile-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .profile-tabs {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .profile-tabs button {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-height: 58px;
    padding: 6px 4px;
    font-size: 12px;
    text-align: center;
  }
  .profile-tabs button span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .channel-actions {
    grid-column: 2 / -1;
    justify-content: flex-start;
  }
  .tg-connect {
    flex-direction: column;
    align-items: center;
  }
}

.tg-code {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* ---------- Адмін ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat {
  padding: 14px 16px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

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

.table-wrap {
  overflow-x: auto;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

.table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table .nowrap {
  white-space: nowrap;
}

.level {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--muted);
}

.level-warn {
  background: var(--warn);
}

.level-error {
  background: var(--danger);
}

.level-info {
  background: var(--good);
}

/* ---------- Вхід і реєстрація ---------- */
.auth {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  min-height: calc(100vh - var(--topbar-h) - 120px);
}

.auth-pitch h1 {
  font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem);
  line-height: 1.1;
}

.auth-pitch h1 em {
  font-style: normal;
  color: var(--accent-strong);
}

.auth-pitch > p {
  margin-top: 14px;
  max-width: 48ch;
  color: var(--muted);
  font-size: 16px;
}

.sample {
  display: block;
  margin-top: 26px;
  max-width: 400px;
  padding: 10px;
  transform: rotate(-1.2deg);
  box-shadow: var(--shadow);
}

.auth-form {
  display: grid;
  gap: 16px;
  padding: 26px;
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  max-width: 440px;
  width: 100%;
  justify-self: center;
}

.auth-form h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
}

.auth-switch {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.auth-switch a {
  color: var(--accent-strong);
  font-weight: 700;
}

/* ---------- Діалоги й повідомлення ---------- */
.dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--fg);
  box-shadow: 0 30px 80px rgb(0 0 0 / 0.35);
}

.dialog::backdrop {
  background: rgb(8 12 20 / 0.55);
  backdrop-filter: blur(2px);
}

.dialog-body {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.dialog-head {
  display: flex;
  gap: 14px;
  align-items: center;
}

.dialog-head .cover {
  width: 120px;
  flex-shrink: 0;
}

.dialog-head .price-values {
  justify-content: flex-start;
  margin-top: 4px;
}

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

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

.match-list {
  display: grid;
  gap: 8px;
}

.match {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.match:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.match input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.match-title {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.toasts {
  position: fixed;
  z-index: 50;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 8px;
  max-width: min(380px, calc(100vw - 32px));
}

.toast {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease-out;
}

.toast.error {
  background: var(--danger);
  color: #fff;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.skeleton {
  height: 120px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface));
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}

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

/* Вузький ноутбук або планшет: меню лише зі значків, щоб усе вмістилося в шапку.
   Підписи не прибираємо зовсім, а ховаємо візуально — їх і далі читають екранні читачі */
@media (min-width: 761px) and (max-width: 1100px) {
  .nav .nav-full,
  .nav a > span:not(.nav-short):not(.nav-full) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Короткі підписи пунктів меню показуються лише на телефоні */
.nav-short {
  display: none;
}

@media (max-width: 760px) {
  .nav .nav-full {
    display: none;
  }
  .nav .nav-short {
    display: inline;
  }
}

/* ---------- Сторінка гри ---------- */
.plain-link {
  color: inherit;
  text-decoration: none;
}

.plain-link:hover {
  text-decoration: underline;
}

.btn-block {
  width: 100%;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.14);
  border: 1px solid rgb(255 255 255 / 0.22);
  font-size: 13px;
  font-weight: 700;
}

.game-hero {
  position: relative;
  overflow: hidden;
  margin: -12px 0 22px;
  border-radius: var(--radius);
  background: #0c111d;
  color: #fff;
}

.game-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  filter: saturate(1.1);
}

.game-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgb(8 12 20 / 0.92), rgb(8 12 20 / 0.55) 60%, rgb(8 12 20 / 0.25));
}

.game-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  padding: 26px 26px 28px;
}

.game-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(26px, 4vw, 40px);
}

.back-link {
  justify-self: start;
  color: rgb(255 255 255 / 0.8);
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  color: #fff;
}

.game-meta {
  margin: 0;
  color: rgb(255 255 255 / 0.8);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.game-main {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.media-viewer {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: #000;
}

.media-viewer img,
.media-viewer video,
.media-viewer iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
}

.media-error {
  display: grid;
  place-items: center;
  height: 100%;
  color: #fff;
  padding: 16px;
  text-align: center;
}

.media-single {
  width: 100%;
  border-radius: var(--radius);
}

.media-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.media-thumb {
  position: relative;
  flex: 0 0 132px;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s, border-color 0.15s;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-thumb:hover,
.media-thumb.active {
  opacity: 1;
}

.media-thumb.active {
  border-color: var(--accent);
}

/* Значок «відтворити» на мініатюрах трейлерів */
.media-thumb.is-video::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform: translate(-35%, -50%);
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #fff;
  filter: drop-shadow(0 1px 3px rgb(0 0 0 / 0.6));
}

.game-about h2 {
  margin: 0 0 10px;
}

.game-about .lead {
  font-size: 17px;
  font-weight: 600;
}

.description p {
  margin: 0 0 10px;
  line-height: 1.6;
}

.description p.bullet {
  padding-left: 18px;
  position: relative;
}

.description p.bullet::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: var(--accent-strong);
}

.description.collapsed {
  max-height: 260px;
  overflow: hidden;
  mask-image: linear-gradient(#000 60%, transparent);
}

/* ---------- Ціни в інших країнах (карта) ---------- */
.game-regional {
  /* Від «набагато дешевше, ніж в Україні» (зелений) до «набагато дорожче» (червоний) */
  --tone-1: #2e9e5b;
  --tone-2: #8ccf9f;
  --tone-3: #e3cf86;
  --tone-4: #f0a07d;
  --tone-5: #d9534f;
}

.game-regional .section-title {
  margin-top: 8px;
}

.game-regional > .hint {
  margin: -6px 0 14px;
}

.regional-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.regional-fact {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.regional-fact span,
.regional-fact small {
  color: var(--muted);
  font-size: 12.5px;
}

.regional-fact span {
  font-weight: 700;
}

.regional-fact b {
  font-family: var(--font-display);
  font-size: 20px;
}

.regional-fact.is-good b {
  color: var(--good);
}

.map-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-2) 35%, var(--surface));
}

.world-map {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.world-map.zoomed {
  touch-action: none;
}

.land {
  fill: var(--surface-2);
  stroke: var(--surface);
  stroke-width: 0.6;
  vector-effect: non-scaling-stroke;
}

.land.has-data {
  cursor: pointer;
  transition: filter 0.15s;
}

.land.tone-1 {
  fill: var(--tone-1);
}

.land.tone-2 {
  fill: var(--tone-2);
}

.land.tone-3 {
  fill: var(--tone-3);
}

.land.tone-4 {
  fill: var(--tone-4);
}

.land.tone-5 {
  fill: var(--tone-5);
}

.land.hl,
.land.has-data:focus-visible {
  outline: none;
  filter: brightness(1.12) saturate(1.2);
  stroke: var(--fg);
  stroke-width: 1.2;
}

.land.is-home,
.land.selected {
  stroke: var(--fg);
  stroke-width: 1.6;
}

.map-tip {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 2px;
  max-width: 260px;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--fg);
  color: var(--bg);
  font-size: 13px;
  box-shadow: var(--shadow);
  pointer-events: none;
}

.map-tip small {
  opacity: 0.8;
}

.map-zoom {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  gap: 4px;
}

.map-zoom .icon-btn {
  width: 32px;
  height: 32px;
  font-size: 17px;
  font-weight: 800;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 12.5px;
}

.map-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-legend i,
.regional-bar i {
  display: block;
  background: var(--surface-2);
}

.map-legend i {
  width: 14px;
  height: 10px;
  border-radius: 3px;
}

.map-legend i.no-data {
  border: 1px solid var(--border);
}

:is(.map-legend, .regional-bar) i.tone-1 {
  background: var(--tone-1);
}

:is(.map-legend, .regional-bar) i.tone-2 {
  background: var(--tone-2);
}

:is(.map-legend, .regional-bar) i.tone-3 {
  background: var(--tone-3);
}

:is(.map-legend, .regional-bar) i.tone-4 {
  background: var(--tone-4);
}

:is(.map-legend, .regional-bar) i.tone-5 {
  background: var(--tone-5);
}

.regional-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 6px solid var(--pick, var(--border));
  border-radius: 12px;
  background: var(--surface);
}

.regional-pick.tone-1 {
  --pick: var(--tone-1);
}

.regional-pick.tone-2 {
  --pick: var(--tone-2);
}

.regional-pick.tone-3 {
  --pick: var(--tone-3);
}

.regional-pick.tone-4 {
  --pick: var(--tone-4);
}

.regional-pick.tone-5 {
  --pick: var(--tone-5);
}

.regional-pick > div {
  display: grid;
  gap: 2px;
}

.regional-pick-price {
  text-align: right;
}

.regional-pick-price b {
  font-family: var(--font-display);
  font-size: 20px;
}

.regional-pick-price span {
  color: var(--muted);
  font-size: 13px;
}

.regional-all {
  margin: 12px 0 8px;
}

.regional-all summary {
  font-weight: 700;
  cursor: pointer;
}

.regional-list {
  display: grid;
  gap: 2px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.regional-row {
  display: grid;
  grid-template-columns: minmax(0, 180px) minmax(0, 1fr) 92px 52px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.regional-row:hover {
  background: var(--surface-2);
}

.regional-row.is-home {
  font-weight: 800;
}

.regional-row-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.regional-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-2);
}

.regional-bar i {
  height: 100%;
  border-radius: 99px;
}

.regional-row-price,
.regional-row-diff {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.regional-row-price {
  font-weight: 700;
}

.regional-row-diff {
  color: var(--muted);
  font-size: 12.5px;
}

@media (max-width: 600px) {
  .regional-facts {
    grid-template-columns: 1fr 1fr;
  }
  .regional-fact:first-child {
    grid-column: 1 / -1;
  }
  .regional-row {
    grid-template-columns: minmax(0, 1fr) 60px 78px 44px;
    gap: 8px;
  }
  .regional-pick {
    flex-wrap: wrap;
  }
}

/* ---------- Коментарі до гри ---------- */
.game-comments .section-title {
  margin-top: 8px;
}

textarea.input {
  min-height: 84px;
  padding: 10px 13px;
  resize: vertical;
  line-height: 1.5;
}

.comment-form,
.comment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
}

.comment-form {
  margin-bottom: 18px;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.comment-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.comment-guest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px dashed var(--border);
  border-radius: 12px;
}

.comments {
  display: grid;
}

.comment {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.comment-delete {
  min-height: 28px;
  margin-left: auto;
  padding: 0 8px;
}

.comment-text {
  margin-top: 4px;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.comments-empty {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.game-side {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow);
}

.game-side-cover {
  width: 100%;
  border-radius: var(--radius-sm);
}

.game-scores {
  display: flex;
  gap: 18px;
}

.game-scores div {
  display: grid;
}

.game-scores strong {
  font-family: var(--font-display);
  font-size: 24px;
}

.game-scores span {
  font-weight: 700;
  font-size: 13px;
}

.game-scores small {
  color: var(--muted);
  font-size: 12px;
}

/* Екран «Перевір пошту» після реєстрації */
.check-email {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 560px;
  margin: 24px auto;
  padding: 36px 28px;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow);
  text-align: center;
}

.check-email h1 {
  margin: 0;
}

.check-email-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  animation: check-email-pop 0.4s ease-out;
}

.check-email-icon.ok {
  background: var(--good-bg);
  color: var(--good);
}

.check-email-icon svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes check-email-pop {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
}

.check-email-lead {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
}

.check-email .hint {
  margin: 0;
}

.check-email-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.check-email-wait {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.check-email-wait .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: check-email-spin 0.9s linear infinite;
}

@keyframes check-email-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .check-email-icon,
  .check-email-wait .spinner {
    animation: none;
  }
}

/* Ключі Steam в офіційних магазинах на сторінці гри */
.keys-box {
  display: grid;
  gap: 8px;
}

.keys-title {
  margin: 0;
  font-size: 14px;
}

.keys-cheaper {
  margin: 0;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--good-bg);
  color: var(--good);
  font-weight: 700;
  font-size: 13px;
}

.keys-list {
  display: grid;
  gap: 6px;
}

.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}

.key-row .store {
  white-space: nowrap;
}

.key-row:hover {
  border-color: var(--keys);
  background: var(--surface-2);
}

.keys-box .hint {
  margin: 0;
  font-size: 12px;
}

.buy-box {
  display: grid;
  gap: 10px;
}

.buy-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.buy-row.best {
  border-color: var(--accent);
}

.buy-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

.buy-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  width: 100%;
}

.buy-prices .price {
  font-size: 20px;
}

.watch-box {
  display: grid;
  gap: 8px;
  justify-items: start;
}

@media (max-width: 900px) {
  .game-layout {
    /* minmax(0, …): інакше довга стрічка мініатюр розтягує сторінку ширше за екран */
    grid-template-columns: minmax(0, 1fr);
  }
  .game-side {
    position: static;
    order: -1;
  }
  .game-side-cover {
    display: none;
  }
}

/* ---------- Підвал, сторінка «Конфіденційність», небезпечні дії ---------- */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  justify-content: center;
  padding: 18px 16px 28px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.site-footer a {
  color: var(--muted);
  font-weight: 700;
}

.doc {
  max-width: 760px;
}

.doc h2 {
  margin: 28px 0 10px;
  font-size: 20px;
}

.doc ul {
  display: grid;
  gap: 8px;
  padding-left: 22px;
  line-height: 1.6;
}

.doc code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-2);
}

.danger-zone {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
}

/* ---------- Імпорт списку бажаного Steam ---------- */
.wish-help {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 14px;
}

.wish-help ol {
  margin: 8px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.wish-help a {
  color: var(--accent-strong);
  font-weight: 700;
}

.wish-profile {
  display: flex;
  gap: 14px;
  align-items: center;
}

.wish-profile img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
}

.wish-profile h2,
.wish-profile p {
  margin: 0;
}

.wish-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  justify-content: space-between;
}

.wish-cond {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
}

.wish-cond .select {
  width: auto;
  min-height: 38px;
}

.wish-list {
  display: grid;
  gap: 4px;
  max-height: min(52vh, 460px);
  overflow: auto;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.wish-row {
  display: grid;
  grid-template-columns: auto 92px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.wish-row:hover {
  background: var(--surface-2);
}

.wish-row.in-list {
  opacity: 0.6;
  cursor: default;
}

.wish-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.wish-row img {
  width: 92px;
  aspect-ratio: 231 / 87;
  border-radius: 5px;
  object-fit: cover;
  background: var(--surface-2);
}

.wish-title {
  display: grid;
  min-width: 0;
}

.wish-title b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wish-price {
  display: flex;
  gap: 6px;
  align-items: center;
  white-space: nowrap;
  font-size: 14px;
}

@media (max-width: 600px) {
  .wish-row {
    grid-template-columns: auto 64px minmax(0, 1fr);
  }
  .wish-row img {
    width: 64px;
  }
  .wish-price {
    grid-column: 3;
  }
}

/* ---------- Поділитися списком і сканер QR ---------- */
.share-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.qr-img {
  width: 220px;
  height: 220px;
  border-radius: var(--radius-sm);
  background: #fff;
  image-rendering: pixelated;
}

.copy-row {
  display: flex;
  gap: 8px;
}

.copy-row .input {
  flex: 1;
  min-width: 0;
}

.scan-box {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #000;
  aspect-ratio: 4 / 3;
}

.scan-box[hidden] {
  display: none;
}

.scan-box video,
.scan-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.55);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.scan-result {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  word-break: break-all;
}

.scan-result p {
  margin: 0;
}

@media (max-width: 600px) {
  .share-grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

/* ---------- Банер-карусель на головній ---------- */
/* Фон вітрини: розмитий кадр гри з банера на всю ширину, донизу тане у звичайний фон */
.page-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: min(1000px, 130vh);
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent);
  mask-image: linear-gradient(to bottom, #000 30%, transparent);
}

.page-backdrop i {
  position: absolute;
  inset: -16px;
  background: center 20% / cover no-repeat;
  filter: blur(5px) saturate(1.1);
  opacity: 0;
  transition: opacity 1.2s ease;
}

.page-backdrop i.on {
  opacity: 0.42;
}

/* У світлій темі фон ледь помітний, щоб текст лишався чітким */
:root:not([data-theme='dark']) .page-backdrop i.on {
  opacity: 0.28;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .page-backdrop i.on {
    opacity: 0.42;
  }
}

@media print {
  .page-backdrop {
    display: none;
  }
}

.hero {
  position: relative;
  height: clamp(260px, 34vw, 400px);
  margin: -8px 0 24px;
  overflow: hidden;
  border-radius: calc(var(--radius) + 4px);
  background: #0c111d;
  color: #fff;
  box-shadow: var(--shadow);
  touch-action: pan-y;
  user-select: none;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease, visibility 0s linear 0.7s;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.7s ease;
}

.hero-img,
.hero .cover-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  object-fit: cover;
  object-position: center 30%;
  transform: scale(1.04);
  transition: transform 6.5s ease-out;
}

.hero-slide.active .hero-img {
  transform: scale(1);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgb(8 12 20 / 0.92) 0%, rgb(8 12 20 / 0.6) 42%, rgb(8 12 20 / 0) 72%),
    linear-gradient(0deg, rgb(8 12 20 / 0.7) 0%, rgb(8 12 20 / 0) 45%);
}

.hero-content {
  position: absolute;
  left: clamp(18px, 4vw, 44px);
  right: 18px;
  bottom: clamp(26px, 4vw, 44px);
  display: grid;
  gap: 12px;
  max-width: 520px;
}

.hero-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  color: rgb(255 255 255 / 0.85);
  font-size: 13px;
  font-weight: 700;
}

.hero-kicker .store {
  color: #fff;
}

.hero-title {
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(22px, 3.4vw, 38px);
  line-height: 1.12;
  text-shadow: 0 2px 16px rgb(0 0 0 / 0.5);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-price {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-discount {
  padding: 4px 10px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
}

.hero-price s {
  color: rgb(255 255 255 / 0.65);
  font-weight: 700;
}

.hero-price strong {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 30px);
  font-variant-numeric: tabular-nums;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-watch {
  background: rgb(255 255 255 / 0.12);
  border-color: rgb(255 255 255 / 0.35);
  color: #fff;
  backdrop-filter: blur(4px);
}

.hero-watch:hover {
  background: rgb(255 255 255 / 0.22);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border: 1px solid rgb(255 255 255 / 0.3);
  border-radius: 50%;
  background: rgb(8 12 20 / 0.45);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}

.hero-arrow.prev {
  left: 14px;
}

.hero-arrow.next {
  right: 14px;
}

.hero:hover .hero-arrow,
.hero-arrow:focus-visible {
  opacity: 1;
}

.hero-arrow:hover {
  background: rgb(8 12 20 / 0.75);
}

.hero-dots {
  position: absolute;
  right: 20px;
  bottom: 18px;
  z-index: 2;
  display: flex;
  gap: 8px;
}

.hero-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.45);
  cursor: pointer;
  transition: width 0.3s, background 0.3s;
}

.hero-dots button.active {
  width: 28px;
  background: var(--accent);
}

@media (max-width: 760px) {
  .hero {
    height: 300px;
    margin-top: -4px;
    border-radius: var(--radius);
  }
  .hero-arrow {
    display: none; /* на телефоні — свайп */
  }
  .hero-shade {
    background: linear-gradient(0deg, rgb(8 12 20 / 0.95) 0%, rgb(8 12 20 / 0.55) 55%, rgb(8 12 20 / 0.1) 100%);
  }
  .hero-content {
    bottom: 34px;
  }
  .hero-dots {
    right: 50%;
    transform: translateX(50%);
    bottom: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide,
  .hero-img {
    transition: none;
  }
}

/* ---------- Перемикач сторінок ---------- */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 26px;
}

.pager-btn {
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.pager-btn:hover:not(:disabled):not(.active) {
  border-color: var(--accent);
}

.pager-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  cursor: default;
}

.pager-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.pager-gap {
  display: grid;
  place-items: center;
  min-width: 24px;
  color: var(--muted);
  font-weight: 700;
}

/* ---------- Вітрина знижок ---------- */
.intro {
  max-width: 720px;
  margin: -6px 0 22px;
  color: var(--muted);
}

/* Панель фільтрів: зверху пошук і сортування, нижче групи з підписами */
.filters {
  /* «Скло» робить панель окремим шаром — піднімаємо її над картками, щоб підказки студій були поверх них */
  position: relative;
  z-index: 5;
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow);
}

.filters-top {
  display: flex;
  gap: 10px;
}

.filter-search {
  position: relative;
  flex: 1;
  min-width: 0;
}

.filter-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 2.2;
  stroke-linecap: round;
  pointer-events: none;
}

.filter-search .input {
  padding-left: 42px;
  background: var(--surface-2);
  border-color: transparent;
}

.filter-search .input:focus {
  background: var(--surface);
  border-color: var(--accent);
}

.filters .filter-sort {
  width: auto;
  min-width: 190px;
  font-weight: 700;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 22px;
}

.filter-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.filter-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filters .segmented button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background-color 0.15s, color 0.15s;
}

.filters .segmented button:hover:not([aria-pressed='true']) {
  color: var(--fg);
  background: rgb(127 127 127 / 0.1);
}

.store-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--steam);
}

.store-dot.gog {
  background: var(--gog);
}

/* Вибрана знижка — кольором цінника */
.segmented.chips button[aria-pressed='true'] {
  background: var(--accent);
  color: var(--on-accent);
}

.filter-price {
  width: 140px;
}

.filters .filter-genre {
  width: auto;
  min-width: 170px;
  min-height: 42px;
}

.filter-company {
  width: 210px;
  min-height: 42px;
}

/* Підказки студій — у тому ж стилі, що й розкриті списки */
.combo {
  position: relative;
}

.combo-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(340px, 90vw);
  max-height: 320px;
  overflow-y: auto;
  margin: 0;
  padding: 5px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.28);
}

.combo-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.combo-list li:hover,
.combo-list li[aria-selected='true'] {
  background: var(--surface-2);
}

.combo-list mark {
  background: none;
  color: var(--accent-strong);
  font-weight: 800;
}

.combo-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.filter-price .input {
  min-height: 42px;
}

.filters-reset {
  margin-left: auto;
  gap: 6px;
}

.filters-reset svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.deal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.deal-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.deal-card:hover {
  transform: translateY(-2px);
}

.deal-cover {
  position: relative;
  display: block;
}

.deal-cover .cover {
  display: block;
  aspect-ratio: 460 / 215;
  border-radius: 0;
}

.deal-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.deal-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
}

.deal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  justify-content: space-between;
}

.deal-rating {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.deal-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.deal-title a {
  color: inherit;
  text-decoration: none;
}

.deal-title a:hover {
  text-decoration: underline;
}

.deal-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.deal-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  align-items: baseline;
}

.deal-prices .price {
  font-size: 18px;
}

.deal-skeleton {
  height: 250px;
}


@media (max-width: 760px) {
  .filters {
    padding: 12px;
  }
  .filters-top {
    flex-wrap: wrap;
  }
  .filters .filter-sort {
    flex: 1 1 100%;
  }
  .filter-group {
    flex: 1 1 100%;
  }
  /* Чіпи гортаються пальцем, якщо не влазять */
  .filters .segmented {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .filters .segmented button {
    flex: 1 0 auto;
    justify-content: center;
  }
  .filter-price,
  .filter-company,
  .filters .filter-genre {
    width: 100%;
  }
  .filters-reset {
    margin-left: 0;
  }
  .deal-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }
  .deal-body {
    padding: 10px;
  }
  .deal-title {
    font-size: 14px;
  }
}

/* Безкоштовні роздачі Epic на вітрині */
.home-freebies {
  margin-bottom: 22px;
}

.home-freebies-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.home-freebies-head h2 {
  margin: 0;
  font-size: 18px;
}

.home-freebies-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.home-freebie {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--good) 9%, var(--surface)));
  color: inherit;
  text-decoration: none;
}

.home-freebie .cover {
  aspect-ratio: 16 / 9;
}

.home-freebie strong {
  display: block;
  line-height: 1.3;
}

/* ---------- Графік ціни ---------- */
.dialog.dialog-wide {
  width: min(880px, calc(100vw - 32px));
}

.series-steam {
  --series: var(--chart-steam);
}

.series-gog {
  --series: var(--chart-gog);
}

/* Ключі — третій колір і пунктир: лінії розрізняються і без кольору */
.series-keys {
  --series: var(--chart-keys);
}

.chart-line.series-keys {
  stroke-dasharray: 6 4;
}

.chart-box {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.chart-top {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  justify-content: space-between;
}

.chart-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
}

.chart-stat {
  display: grid;
  gap: 2px;
}

.chart-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chart-stat strong {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.2;
}

.chart-stat small {
  color: var(--muted);
  font-size: 12px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  font-weight: 700;
}

.legend-item,
.chart-tip-row > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-line {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--series);
}

.chart-plot {
  position: relative;
  border-radius: var(--radius-sm);
  outline: none;
  touch-action: pan-y;
  cursor: crosshair;
}

.chart-plot:focus-visible {
  box-shadow: var(--ring);
}

.chart-plot svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-axis {
  fill: var(--muted);
  font-family: var(--font-body);
  font-size: 12px;
}

.chart-line {
  fill: none;
  stroke: var(--series);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-end-label,
.chart-min-label {
  fill: var(--fg);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
}

.chart-min-label {
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.chart-min-dot {
  fill: var(--surface);
  stroke: var(--fg);
  stroke-width: 2;
}

.chart-dot {
  fill: var(--series);
  stroke: var(--surface);
  stroke-width: 2;
}

.chart-cross {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.chart-tip {
  position: absolute;
  top: 6px;
  z-index: 2;
  display: grid;
  gap: 4px;
  min-width: 170px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13px;
  white-space: nowrap;
  pointer-events: none;
}

.chart-tip.flip {
  transform: translateX(-100%);
}

.chart-tip-date {
  color: var(--muted);
  font-weight: 700;
}

.chart-tip-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.chart-tip-row .legend-line {
  width: 12px;
}

.chart-table summary {
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.chart-table .table-wrap {
  max-height: 260px;
  margin-top: 8px;
  overflow: auto;
}

/* ---------- Мобільна версія ---------- */
@media (max-width: 900px) {
  .game-card {
    grid-template-columns: 150px minmax(0, 1fr);
  }
  .game-card .prices {
    grid-column: 1 / -1;
  }
  .auth {
    grid-template-columns: 1fr;
    gap: 28px;
    min-height: 0;
  }
  .sample {
    display: none;
  }
}

@media (max-width: 760px) {
  /* backdrop-filter робить панель «контейнером» для position: fixed,
     тому на телефоні прибираємо його, щоб нижнє меню кріпилося до екрана */
  .topbar {
    gap: 10px;
    backdrop-filter: none;
    background: var(--bg);
  }
  .nav {
    position: fixed;
    z-index: 30;
    left: 0;
    right: 0;
    bottom: 0;
    justify-content: space-around;
    gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    border-top: 1px solid var(--border);
  }
  .nav a {
    flex-direction: column;
    gap: 2px;
    padding: 6px 4px;
    font-size: 11px;
    flex: 1;
    min-width: 0;
  }
  .nav a span {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .nav a.active {
    background: transparent;
    color: var(--accent-strong);
  }
  .nav-count {
    position: absolute;
    top: 0;
    left: 50%;
    margin-left: 6px;
  }
  body.has-nav .container {
    padding-bottom: 24px;
  }
  body.has-nav .site-footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
  body.has-nav .toasts {
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }
  .container {
    padding-block: 20px 48px;
  }
  .game-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .game-card .cover {
    max-height: 120px;
  }
  .cond-grid {
    grid-template-columns: 1fr;
  }
  .dialog-head .cover {
    width: 90px;
  }
  .search-bar {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .sample {
    transform: none;
  }
}

/* ---------- Друк ---------- */
/* Лише для паперу: шапка з назвою сайту, ім'ям і датою */
.print-only {
  display: none;
}

@media print {
  /* На папері завжди світла тема, хоч би яку вибрано на екрані */
  :root,
  :root[data-theme],
  :root:not([data-theme='light']) {
    --bg: #fff;
    --surface: #fff;
    --surface-2: #f1f3f7;
    --border: #c9d0dc;
    --fg: #000;
    --muted: #4a5366;
    --accent: #f29a2e;
    --accent-strong: #9a5300;
    --good: #0d6630;
    --good-bg: #dcf4e3;
    --danger: #b3261e;
    --shadow: none;
  }

  @page {
    margin: 14mm 12mm;
  }

  body {
    background: #fff;
    color: #000;
  }

  .topbar,
  .nav,
  .site-footer,
  .demo-banner,
  .verify-banner,
  .offline-banner,
  .toasts,
  .dialog,
  .page-head .row,
  .game-actions,
  .back-link,
  .watch-box,
  .comment-form,
  .comment-guest,
  .comment-delete,
  .media-strip,
  .media-viewer {
    display: none !important;
  }

  .print-only {
    display: block;
  }

  .print-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid #000;
    font-size: 12px;
  }

  .print-head b {
    font-family: var(--font-display);
  }

  main.container {
    max-width: none;
    padding: 0;
  }

  .page-head {
    margin-bottom: 10px;
  }

  /* Картка гри: обкладинка, назва з умовою, ціни — і не розривається між сторінками */
  .game-list {
    gap: 8px;
  }

  .game-card {
    grid-template-columns: 104px minmax(0, 1fr) 280px;
    gap: 12px;
    padding: 10px;
    break-inside: avoid;
    box-shadow: none;
  }

  .game-card .cover {
    border-radius: 4px;
  }

  .game-card .prices {
    grid-column: auto; /* аркуш вузький, як планшет, але ціни лишаємо в рядку з назвою */
  }

  .game-card .game-main {
    gap: 4px;
  }

  .buy-box .btn {
    display: none;
  }

  .price-row {
    padding: 4px 8px;
    color: #000;
    text-decoration: none;
  }

  a {
    color: inherit;
  }

  .comment,
  .panel,
  .game-side {
    break-inside: avoid;
  }

  .game-side {
    position: static;
  }

  .description.collapsed {
    max-height: none;
    mask-image: none;
  }

  #more-desc {
    display: none;
  }
}
