/* ── Бонусы (bonuses.js) ─────────────────────────────────────────────────
   Hero and the coins are fixed colours on purpose, like the loyalty hero and the
   gift cards: an object that looks the same in every mood. Everything else runs
   on tokens, so moods repaint it. Every rule below works at 360px. */

.bn-tabs { margin-bottom: 18px; }
.bn-h { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin: 22px 0 12px; letter-spacing: -0.01em; }
.bn-h.sm { font-size: 15px; margin: 0 0 12px; }
.bn-lead { margin: -4px 0 14px; max-width: 72ch; }

/* ── Hero ── */
.bn-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px 28px; align-items: center;
  padding: 28px 30px; border-radius: var(--r-xl); color: #f6efe3;
  background:
    radial-gradient(100% 120% at 100% 0%, rgba(232, 176, 60, 0.42), transparent 55%),
    radial-gradient(80% 120% at 0% 100%, rgba(43, 143, 105, 0.45), transparent 60%),
    linear-gradient(160deg, #24304f 0%, #1b2440 60%, #172038 100%);
  box-shadow: 0 30px 60px -36px rgba(21, 27, 51, 0.8);
}
.bn-eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.bn-hero h3 { font-family: var(--font-display); font-size: 26px; font-weight: 700; margin: 6px 0 10px; letter-spacing: -0.02em; color: #fff; }
.bn-hero p { margin: 0; opacity: .85; line-height: 1.55; max-width: 52ch; }
.bn-hero-coins { position: relative; height: 170px; }
.bn-coin {
  position: absolute; display: grid; place-content: center; text-align: center;
  width: 118px; height: 118px; border-radius: 50%; color: #3b2a07;
  background: radial-gradient(circle at 32% 28%, #fff4cf 0%, #f2c75c 38%, #c9921f 100%);
  box-shadow: inset 0 -6px 0 rgba(120, 80, 10, .35), inset 0 0 0 6px rgba(255, 240, 200, .35), 0 16px 30px -14px rgba(0, 0, 0, .6);
  animation: bn-float 6s ease-in-out infinite;
}
.bn-coin span { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.bn-coin small { font-size: 11px; font-weight: 600; opacity: .75; }
.bn-coin.c1 { left: 4%; top: 30px; }
.bn-coin.c2 { left: 36%; top: 0; animation-delay: -2s; background: radial-gradient(circle at 32% 28%, #e8fff3 0%, #6fd3a5 40%, #2b8f69 100%); color: #08321f; }
.bn-coin.c3 { left: 66%; top: 44px; animation-delay: -4s; background: radial-gradient(circle at 32% 28%, #ffe6d6 0%, #f39a67 40%, #c55a26 100%); color: #3b1505; }
@keyframes bn-float { 50% { transform: translateY(-8px) rotate(-3deg); } }
@media (prefers-reduced-motion: reduce) { .bn-coin { animation: none; } }

/* ── Three ways ── */
.bn-ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.bn-way {
  background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-lg);
  padding: 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.bn-way.hot { background: linear-gradient(180deg, var(--accent-weak), var(--surface) 70%); }
.bn-way h4 { margin: 0; font-size: 16px; }
.bn-way-ic { font-size: 26px; line-height: 1; }
.bn-way p { margin: 0; line-height: 1.5; }
.bn-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bn-split > div { background: var(--elevated); border-radius: var(--r-md); padding: 10px 12px; min-width: 0; }
.bn-split small { display: block; font-size: 12px; color: var(--ink-2); margin-top: 4px; line-height: 1.35; }
.bn-big { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.bn-big.strike { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--subtle); font-size: 20px; }
.bn-cur { font-size: 15px; margin-left: 3px; color: var(--ink-2); }
.bn-x2 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.bn-arrow { color: var(--accent-ink); font-weight: 700; font-size: 20px; }

/* ── Road of one trip ── */
.bn-road {
  list-style: none; padding: 0; margin: 0 0 18px; counter-reset: none;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; position: relative;
}
.bn-road::before {
  content: ""; position: absolute; left: 6%; right: 6%; top: 18px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--field-border) 0 8px, transparent 8px 14px); z-index: 0;
}
.bn-road li { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; min-width: 0; }
.bn-road b { font-size: 14px; }
.bn-road small { font-size: 12px; color: var(--ink-2); line-height: 1.35; }
.bn-dot {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-content: center; font-weight: 700;
  background: var(--surface); border: 2px solid var(--ink); color: var(--ink); margin-bottom: 4px;
}
.bn-road li.win .bn-dot { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-weak); }
.bn-road li.end .bn-dot { border-color: var(--subtle); color: var(--subtle); }

.bn-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.bn-two > .panel { min-width: 0; }

/* ── States ── */
.bn-states { display: grid; gap: 8px; margin-bottom: 12px; }
.bn-st {
  border-radius: var(--r-md); padding: 10px 12px; font-weight: 600; font-size: 14px; border: 1px solid var(--stroke);
}
.bn-st small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.bn-st.pending { background: var(--blue-weak); }
.bn-st.available { background: var(--green-weak); }
.bn-st.spent { background: var(--accent-weak); }
.bn-st.expired { background: var(--elevated); color: var(--ink-2); }
.bn-st.reversed { background: var(--red-weak); }
.bn-st-arrow { font-size: 12px; color: var(--ink-2); padding-left: 12px; }
.bn-st-arrow::before { content: "↓ "; }
.bn-st-fork { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ── Tables ── */
.bn-table-wrap { overflow-x: auto; }
.bn-table td small { display: block; }
.bn-table td small.muted, .bn-table td .muted { font-size: 12px; }
.bn-ledger b.plus, .bn-rc-row.plus b { color: var(--green); }
.bn-ledger b.minus, .bn-rc-row.minus b { color: var(--accent-ink); }

/* ── Lifetime bars ── */
.bn-bars, .bn-funnel { display: grid; gap: 8px; margin-bottom: 10px; }
.bn-bar-row, .bn-f-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13.5px; }
.bn-bar { height: 12px; border-radius: var(--r-pill); background: var(--elevated); overflow: hidden; }
.bn-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ink); transition: width .4s ease; }
.bn-bar i.d { background: var(--accent); }
.bn-bar i.s { background: var(--green); }
.bn-bar i.i { background: var(--blue); }
.bn-funnel .bn-bar i { background: var(--accent); }

.bn-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; line-height: 1.5; font-size: 13.5px; }

/* ── What the traveller sees ── */
.bn-client { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.bn-client > h3 { grid-column: 1 / -1; }
.bn-phone {
  border: 8px solid var(--ink); border-radius: 26px; padding: 14px; background: var(--surface);
  display: grid; gap: 8px; font-size: 13px;
}
.bn-phone-row { display: flex; justify-content: space-between; gap: 8px; }
.bn-phone-line { font-size: 12px; color: var(--ink-2); border-top: 1px solid var(--divider); padding-top: 8px; }

/* ── Cases ── */
.bn-cases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.bn-case {
  background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-lg);
  padding: 18px; min-width: 0; display: flex; flex-direction: column; gap: 10px;
}
.bn-case header { display: flex; gap: 12px; align-items: center; }
.bn-case h4 { margin: 0; font-size: 15px; }
.bn-case-ic { font-size: 24px; width: 42px; height: 42px; display: grid; place-content: center; border-radius: 12px; background: var(--elevated); flex: none; }
.bn-case p { margin: 0; line-height: 1.5; font-size: 13.5px; }
.bn-case.hot .bn-case-ic { background: var(--accent-weak); }
.bn-case.warn .bn-case-ic { background: var(--red-weak); }
.bn-case.muted .bn-case-ic { background: var(--blue-weak); }
.bn-tag { display: inline-block; font-size: 11.5px; color: var(--ink-2); background: var(--elevated); border-radius: var(--r-pill); padding: 2px 9px; margin-top: 3px; }
.bn-result { background: var(--paper-2, var(--elevated)); border-left: 3px solid var(--accent); padding: 10px 12px; border-radius: var(--r-sm); }

/* ── Calculator ── */
.bn-calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.bn-calc-form { display: grid; gap: 12px; }
.bn-calc-form .field > span { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.bn-check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; cursor: pointer; }
.bn-check:has(input:disabled) { opacity: .45; cursor: default; }
.bn-receipt {
  background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-lg); padding: 18px 20px;
  display: grid; gap: 8px; position: sticky; top: 16px;
  background-image: radial-gradient(circle at 8px 0, transparent 7px, var(--surface) 7.5px);
}
.bn-receipt-head { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--subtle); margin-top: 6px; }
.bn-rc-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.bn-rc-total { display: flex; justify-content: space-between; gap: 10px; border-top: 2px dashed var(--field-border); padding-top: 10px; margin-top: 4px; }
.bn-rc-total b { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.bn-rc-note { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.bn-rc-notes { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); }
.bn-warn { color: var(--red); font-weight: 600; }

/* ── Money ── */
.bn-kpi .card .label { line-height: 1.4; }
.bn-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bn-legend { font-size: 12px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bn-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.bn-legend i.c, .bn-col-bars i.c { background: var(--green); }
.bn-legend i.s, .bn-col-bars i.s { background: var(--accent); }
.bn-legend i.e, .bn-col-bars i.e { background: var(--subtle); }
.bn-chart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 190px; align-items: end; margin: 8px 0 10px; }
.bn-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.bn-col-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--divider); }
.bn-col-bars i { width: 30%; max-width: 12px; border-radius: 3px 3px 0 0; min-height: 0; }
.bn-col > span { font-size: 11px; color: var(--subtle); white-space: nowrap; }
.bn-mini { display: grid; gap: 6px; margin-top: 12px; }
.bn-mini > div { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; border-bottom: 1px dashed var(--divider); padding-bottom: 6px; }
.bn-mini span { color: var(--ink-2); }

/* ── Invites ── */
.bn-hot {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; margin-bottom: 14px;
  background: var(--red-weak); border-radius: var(--r-md); font-size: 13.5px;
}
.bn-hot-p { background: var(--surface); border-radius: var(--r-pill); padding: 3px 10px; font-weight: 600; }
.bn-inv-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.bn-inv-bar input[type="search"] { flex: 1 1 240px; max-width: 360px; min-width: 0; }
.bn-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.bn-chip {
  border: 1px solid var(--stroke); background: var(--surface); border-radius: var(--r-pill);
  padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--ink-2);
}
.bn-chip span { color: var(--subtle); margin-left: 4px; font-variant-numeric: tabular-nums; }
.bn-chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.bn-chip.on span { color: rgba(255, 255, 255, .7); }
.bn-stage { display: inline-block; border-radius: var(--r-pill); padding: 2px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.bn-stage.bound { background: var(--elevated); color: var(--ink-2); }
.bn-stage.booked { background: var(--blue-weak); color: var(--blue); }
.bn-stage.paid { background: var(--amber-weak); color: var(--amber); }
.bn-stage.travelled { background: var(--green-weak); color: var(--green); }
.bn-more { margin: 0 auto 18px; display: block; }

/* ── Narrow screens ── */
@media (max-width: 1100px) {
  .bn-ways { grid-template-columns: minmax(0, 1fr); }
  .bn-cases { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .bn-two, .bn-calc, .bn-client { grid-template-columns: minmax(0, 1fr); }
  .bn-receipt { position: static; }
  .bn-road { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .bn-road::before { left: 17px; right: auto; top: 18px; bottom: 18px; width: 2px; height: auto;
    background: repeating-linear-gradient(180deg, var(--field-border) 0 8px, transparent 8px 14px); }
  .bn-road li { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; text-align: left; align-items: start; padding-bottom: 12px; }
  .bn-road li .bn-dot { grid-row: span 2; margin: 0; }
}
@media (max-width: 640px) {
  .bn-hero { grid-template-columns: minmax(0, 1fr); padding: 22px 18px; }
  .bn-hero h3 { font-size: 21px; }
  .bn-hero-coins { height: 120px; }
  .bn-coin { width: 88px; height: 88px; }
  .bn-coin span { font-size: 17px; }
  .bn-coin small { font-size: 10px; }
  .bn-coin.c1 { left: 0; top: 24px; } .bn-coin.c2 { left: 34%; top: 0; } .bn-coin.c3 { left: auto; right: 0; top: 30px; }
  .bn-split { grid-template-columns: minmax(0, 1fr); }
  .bn-bar-row, .bn-f-row { grid-template-columns: minmax(0, 1fr) auto; }
  .bn-bar-row .bn-bar, .bn-f-row .bn-bar { grid-column: 1 / -1; grid-row: 2; }
  .bn-chart { gap: 2px; height: 150px; }
  .bn-col > span { font-size: 9.5px; }
  .bn-st-fork { grid-template-columns: minmax(0, 1fr); }
  .bn-inv-bar input[type="search"] { max-width: none; }
}

/* ── Великие люди (only admin) ──────────────────────────────────────────
   Fixed colours on purpose: an object, like the hero. */
#view-bonuses .view-head { align-items: flex-start; flex-wrap: wrap; }
.bn-quote {
  margin: 0 0 0 auto; width: 420px; max-width: 100%; min-width: 0; position: relative;
  padding: 14px 18px 12px 46px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, #fff8e8, #f6ead0); color: #3b2f1a;
  border: 1px solid rgba(160, 120, 40, .25); box-shadow: 0 10px 24px -18px rgba(80, 50, 0, .6);
}
.bn-quote::before {
  content: "\201C"; position: absolute; left: 12px; top: -6px;
  font: 700 58px/1 Georgia, "Times New Roman", serif; color: #c9921f; opacity: .8;
}
.bn-quote-kicker { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #9a7a3c; margin-bottom: 4px; }
.bn-quote-text {
  margin: 0; font: italic 500 17px/1.35 Georgia, "Times New Roman", serif; cursor: pointer;
  min-height: 2.7em; outline: none;
}
.bn-quote-text:focus-visible { text-decoration: underline dotted; }
.bn-quote-body { cursor: pointer; outline: none; min-height: 2.7em; }
.bn-quote-body:focus-visible { outline: 2px dotted #c9921f; outline-offset: 2px; }
.bn-quote-body.in { animation: bn-quote-in .5s ease; }
.bn-quote-pic { display: block; width: 100%; height: 170px; object-fit: cover; object-position: center 30%; border-radius: 8px; cursor: zoom-in; }
.bn-quote.is-pic { padding-left: 18px; }
.bn-quote.is-pic::before { display: none; }
@keyframes bn-quote-in { from { opacity: 0; transform: translateY(4px); } }
.bn-quote figcaption {
  display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 6px;
  font: 600 13px/1.2 var(--font-ui); color: #6b5427; font-variant: small-caps; letter-spacing: .02em;
}
.bn-quote-dog { border: none; background: none; cursor: pointer; font-size: 16px; padding: 2px; border-radius: 6px; line-height: 1; }
.bn-quote-dog:hover { background: rgba(160, 120, 40, .15); }

.bn-flash {
  position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 16px; cursor: pointer;
  background: rgba(10, 18, 8, .72); animation: bn-flash-in .25s ease;
}
@keyframes bn-flash-in { from { opacity: 0; } }
.bn-flash-card {
  width: min(440px, 100%); background: #fff; color: #111; border-radius: 10px; overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); font-family: Impact, "Arial Black", var(--font-ui);
}
.bn-flash-top, .bn-flash-bottom { padding: 12px 16px; font-size: 18px; line-height: 1.25; text-align: center; font-family: var(--font-ui); font-weight: 700; }
.bn-flash-scene { position: relative; background: #222; line-height: 0; }
.bn-flash-scene img { display: block; width: 100%; height: auto; max-height: 60vh; object-fit: cover; animation: bn-flicker 2.4s steps(1) infinite; }
@keyframes bn-flicker { 0%, 100% { opacity: 1; } 47% { opacity: .85; } 49% { opacity: 1; } 77% { opacity: .92; } }
.bn-flash-hint { text-align: center; font: 12px/1 var(--font-ui); color: #888; padding: 0 0 12px; }
@media (prefers-reduced-motion: reduce) {
  .bn-flash-scene img, .bn-quote-body.in { animation: none; }
}
@media (max-width: 640px) {
  .bn-quote { max-width: none; width: 100%; margin: 4px 0 0; }
  .bn-quote-text { font-size: 15.5px; }
}
