/* =========================================================================
   FT Revival — Личный кабинет
   Dark-fantasy MMORPG parchment theme. Matches the main site's style tokens.
   ========================================================================= */

/* ------------------------------- TOKENS -------------------------------- */
:root {
  /* Brand palette (mirrors the main site style.css) */
  --ft-primary: #ff9100;          /* fire-dragon orange */
  --ft-primary-deep: #d96e00;
  --ft-secondary: #800080;        /* dark magic purple */
  --ft-secondary-soft: #b14fb1;
  --ft-accent: #ffd700;           /* gold */
  --ft-accent-soft: #ffe879;
  --ft-bg-dark: #1a0524;          /* deep dark purple */
  --ft-bg-darker: #11031a;
  --ft-text-light: #f8e7d0;
  --ft-text-dim: #c9b59c;
  --ft-panel-bg: rgba(26, 5, 36, 0.85);
  --ft-panel-bg-2: rgba(40, 10, 56, 0.78);
  --ft-border-color: rgba(255, 215, 0, 0.3);
  --ft-border-strong: rgba(255, 215, 0, 0.55);

  --ft-good: #5fd17a;             /* credit / online */
  --ft-bad: #ff6b6b;              /* debit / error */
  --ft-warn: #ffb347;

  /* Type */
  --font-display: 'Cinzel', 'Times New Roman', serif;
  --font-body: 'Lato', system-ui, -apple-system, sans-serif;

  /* Geometry */
  --radius: 14px;
  --radius-sm: 9px;
  --gap: clamp(14px, 2.2vw, 26px);
  --ring: 0 0 0 1px var(--ft-border-color);
  --shadow-panel: 0 18px 48px -22px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(0,0,0,0.4) inset;
  --glow-orange: 0 0 24px rgba(255, 145, 0, 0.45);
}

/* ------------------------------- RESET --------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
/* Author display rules (.topbar{display:flex}, .modal-root{display:grid}, …) beat
   the UA [hidden]{display:none}. The app toggles visibility via the `hidden`
   attribute (setChrome, modal open/close), so normalize it globally. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ft-text-light);
  background:
    radial-gradient(1200px 700px at 78% -8%, rgba(128, 0, 128, 0.55), transparent 60%),
    radial-gradient(1000px 720px at 8% 110%, rgba(255, 145, 0, 0.16), transparent 55%),
    linear-gradient(160deg, #240735 0%, var(--ft-bg-dark) 42%, var(--ft-bg-darker) 100%);
  background-attachment: fixed;
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--ft-accent); outline-offset: 2px; border-radius: 4px; }

/* --------------------------- BACKGROUND FX ----------------------------- */
.bg-aurora, .bg-grain, .bg-embers {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
}
.bg-aurora {
  background:
    radial-gradient(600px 600px at 85% 12%, rgba(177, 79, 177, 0.22), transparent 70%),
    radial-gradient(520px 520px at 12% 80%, rgba(255, 145, 0, 0.13), transparent 70%);
  mix-blend-mode: screen;
  animation: auroraDrift 22s ease-in-out infinite alternate;
}
@keyframes auroraDrift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1.02); }
  to   { transform: translate3d(2%, 1.5%, 0) scale(1.06); }
}
.bg-grain {
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.bg-embers { overflow: hidden; }
.ember {
  position: absolute; bottom: -12px;
  width: 4px; height: 4px; border-radius: 50%;
  background: radial-gradient(circle, var(--ft-accent-soft), var(--ft-primary) 60%, transparent 75%);
  box-shadow: 0 0 8px 1px rgba(255, 145, 0, 0.55);
  animation: emberRise linear infinite;
  opacity: 0;
}
@keyframes emberRise {
  0%   { transform: translateY(0) translateX(0) scale(0.6); opacity: 0; }
  12%  { opacity: 0.9; }
  85%  { opacity: 0.7; }
  100% { transform: translateY(-104vh) translateX(28px) scale(1.1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bg-aurora, .ember { animation: none !important; }
}

/* ------------------------------ TOPBAR --------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: clamp(10px, 2vw, 24px);
  padding: 12px clamp(14px, 3vw, 36px);
  background: linear-gradient(180deg, rgba(17, 3, 26, 0.96), rgba(17, 3, 26, 0.74));
  backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 1px solid var(--ft-border-color);
  box-shadow: 0 10px 30px -18px rgba(0,0,0,0.9);
}
.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.brand-mark {
  font-size: 1.55rem; color: var(--ft-accent);
  text-shadow: 0 0 14px rgba(255, 215, 0, 0.7);
  animation: spinPulse 6s ease-in-out infinite;
}
@keyframes spinPulse { 50% { transform: rotate(180deg) scale(1.12); } }
.brand-text {
  font-family: var(--font-display); font-weight: 700; font-size: 1.18rem;
  letter-spacing: 0.04em; line-height: 1; color: var(--ft-text-light);
  display: flex; flex-direction: column; gap: 2px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.6);
}
.brand-text small {
  font-family: var(--font-body); font-weight: 400; font-size: 0.6rem;
  letter-spacing: 0.32em; text-transform: uppercase; color: var(--ft-text-dim);
}

.mainnav { display: flex; gap: 4px; margin-left: 8px; flex: 1 1 auto; }
.mainnav a {
  position: relative;
  padding: 9px 16px; border-radius: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.92rem;
  letter-spacing: 0.03em; color: var(--ft-text-dim);
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}
.mainnav a::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 5px; height: 2px;
  background: linear-gradient(90deg, var(--ft-primary), var(--ft-accent));
  transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease;
  border-radius: 2px;
}
.mainnav a:hover { color: var(--ft-text-light); background: rgba(255, 215, 0, 0.06); }
.mainnav a:hover::after { transform: scaleX(1); }
.mainnav a.is-active {
  color: var(--ft-accent);
  background: rgba(255, 145, 0, 0.1);
  box-shadow: inset 0 0 0 1px var(--ft-border-color);
}
.mainnav a.is-active::after { transform: scaleX(1); }

.topbar-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.balance-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(128, 0, 128, 0.4), rgba(255, 145, 0, 0.16));
  border: 1px solid var(--ft-border-color);
  box-shadow: inset 0 0 12px rgba(255, 215, 0, 0.1);
  transition: transform 0.18s, box-shadow 0.2s;
  white-space: nowrap;
}
.balance-chip:hover { transform: translateY(-1px); box-shadow: var(--glow-orange); }
.balance-chip__icon { color: var(--ft-accent); font-size: 0.95rem; }
.balance-chip__val { font-family: var(--font-display); font-weight: 700; color: var(--ft-accent-soft); font-size: 1.02rem; }
.balance-chip__lbl { font-size: 0.74rem; color: var(--ft-text-dim); text-transform: uppercase; letter-spacing: 0.08em; }
.balance-chip.flash { animation: chipFlash 0.9s ease; }
@keyframes chipFlash {
  0% { box-shadow: 0 0 0 0 rgba(95, 209, 122, 0.6); }
  100% { box-shadow: 0 0 0 14px rgba(95, 209, 122, 0); }
}

.navmenu-toggle { display: none; }

/* ------------------------------ BUTTONS -------------------------------- */
.btn {
  --b-bg: linear-gradient(135deg, var(--ft-primary), var(--ft-accent));
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border: none; border-radius: 11px;
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
  letter-spacing: 0.03em; color: #2a1102;
  background: var(--b-bg);
  box-shadow: 0 8px 22px -10px rgba(255, 145, 0, 0.7), inset 0 1px 0 rgba(255,255,255,0.35);
  transition: transform 0.16s ease, box-shadow 0.22s ease, filter 0.2s;
}
.btn::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.55) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.6s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -10px rgba(255, 145, 0, 0.85), inset 0 1px 0 rgba(255,255,255,0.4); filter: saturate(1.1); }
.btn:hover::after { transform: translateX(120%); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); transform: none; box-shadow: none; }
.btn[disabled]::after { display: none; }

.btn--ghost {
  color: var(--ft-text-light);
  background: rgba(255, 215, 0, 0.05);
  box-shadow: inset 0 0 0 1px var(--ft-border-color);
}
.btn--ghost:hover { background: rgba(255, 215, 0, 0.12); box-shadow: inset 0 0 0 1px var(--ft-border-strong); }
.btn--logout { padding: 9px 16px; font-size: 0.85rem; }
.btn--block { width: 100%; }
.btn--lg { padding: 14px 26px; font-size: 1.02rem; }
.btn--purple { --b-bg: linear-gradient(135deg, var(--ft-secondary), var(--ft-secondary-soft)); color: #fff; }

/* ------------------------------ PANELS --------------------------------- */
.view {
  position: relative; z-index: 1;
  max-width: 1180px; margin: 0 auto;
  padding: clamp(20px, 4vw, 44px) clamp(14px, 3vw, 36px) 64px;
}

/* Parchment card with gold border + decorative corner brackets */
.game-panel {
  position: relative;
  background: var(--ft-panel-bg);
  background-image:
    linear-gradient(180deg, rgba(255,215,0,0.035), transparent 30%),
    radial-gradient(120% 80% at 50% -20%, rgba(128,0,128,0.18), transparent 60%);
  border: 2px solid var(--ft-border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
  padding: clamp(18px, 2.6vw, 30px);
}
.game-panel::before, .game-panel::after {
  content: ""; position: absolute; width: 22px; height: 22px; pointer-events: none;
  border-color: var(--ft-accent); border-style: solid; opacity: 0.85;
}
.game-panel::before { top: 8px; left: 8px; border-width: 2px 0 0 2px; border-top-left-radius: 5px; }
.game-panel::after  { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; border-bottom-right-radius: 5px; }
/* extra two corners via a wrapper span */
.game-panel > .corner-tr, .game-panel > .corner-bl {
  position: absolute; width: 22px; height: 22px; pointer-events: none;
  border-color: var(--ft-accent); border-style: solid; opacity: 0.85;
}
.game-panel > .corner-tr { top: 8px; right: 8px; border-width: 2px 2px 0 0; border-top-right-radius: 5px; }
.game-panel > .corner-bl { bottom: 8px; left: 8px; border-width: 0 0 2px 2px; border-bottom-left-radius: 5px; }

/* ------------------------------ HEADINGS ------------------------------- */
.h-display {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem); line-height: 1.1;
  letter-spacing: 0.01em; margin: 0;
  background: linear-gradient(100deg, var(--ft-accent-soft), var(--ft-primary) 55%, var(--ft-secondary-soft));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 18px rgba(255, 145, 0, 0.18);
}
.section-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem); letter-spacing: 0.03em;
  margin: 0 0 4px; color: var(--ft-text-light);
  display: flex; align-items: center; gap: 10px;
}
.section-title .sigil { color: var(--ft-accent); filter: drop-shadow(0 0 6px rgba(255,215,0,0.5)); }
.muted { color: var(--ft-text-dim); }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.28em; font-size: 0.72rem;
  color: var(--ft-accent); font-weight: 700;
}

/* divider */
.rule {
  height: 1px; border: 0; margin: 18px 0;
  background: linear-gradient(90deg, transparent, var(--ft-border-color), transparent);
}

/* ============================ AUTH (login/register) ===================== */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center;
  padding: clamp(24px, 6vh, 80px) 18px; position: relative; z-index: 1;
}
.auth-card {
  width: min(440px, 100%);
  animation: rise 0.6s cubic-bezier(.2,.8,.2,1) both;
}
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand .crest {
  font-size: 2.6rem; color: var(--ft-accent);
  text-shadow: 0 0 26px rgba(255, 215, 0, 0.65); display: inline-block;
  animation: float 5s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-7px); } }
.auth-brand h1 {
  font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; margin: 8px 0 2px;
  letter-spacing: 0.05em; color: var(--ft-text-light);
}
.auth-brand p { margin: 0; color: var(--ft-text-dim); font-size: 0.9rem; letter-spacing: 0.04em; }

.field { margin-bottom: 16px; }
.field label {
  display: block; margin-bottom: 6px; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--ft-accent); font-weight: 700;
}
.field input, .ft-select, .field select {
  width: 100%; padding: 12px 14px;
  background: rgba(8, 2, 14, 0.6);
  border: 1.5px solid var(--ft-border-color); border-radius: var(--radius-sm);
  color: var(--ft-text-light); font-size: 1rem; font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field input::placeholder, .field textarea::placeholder { color: rgba(201, 181, 156, 0.5); }
.field input:focus, .ft-select:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--ft-primary);
  box-shadow: 0 0 0 3px rgba(255, 145, 0, 0.18), inset 0 0 12px rgba(255,145,0,0.06);
  background: rgba(8, 2, 14, 0.78);
}
/* Bug-report form: textarea shares the input look; stacked single column. */
.field textarea {
  width: 100%; padding: 12px 14px;
  background: rgba(8, 2, 14, 0.6);
  border: 1.5px solid var(--ft-border-color); border-radius: var(--radius-sm);
  color: var(--ft-text-light); font-size: 1rem; font-family: var(--font-body);
  resize: vertical; min-height: 96px; line-height: 1.45;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.bugform { margin-top: 4px; }
.field .hint { font-size: 0.76rem; color: var(--ft-text-dim); margin-top: 5px; }
.field .err { font-size: 0.78rem; color: var(--ft-bad); margin-top: 5px; min-height: 1em; }

.field--consent .consent-label {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--ft-text-dim);
    cursor: pointer;
}
.field--consent input[type="checkbox"] { margin-top: 3px; flex: 0 0 auto; cursor: pointer; }
.field--consent .consent-label a { color: var(--ft-accent); font-weight: 700; }
.field--consent .consent-label a:hover { text-decoration: underline; }

.auth-foot { text-align: center; margin-top: 18px; font-size: 0.9rem; color: var(--ft-text-dim); }
.auth-foot a { color: var(--ft-accent); font-weight: 700; }
.auth-foot a:hover { text-decoration: underline; }
.form-error {
  background: rgba(255, 107, 107, 0.12); border: 1px solid rgba(255, 107, 107, 0.4);
  color: #ffb3b3; border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 0.88rem; margin-bottom: 14px;
}

/* ============================ OVERVIEW ================================== */
.greet { margin-bottom: var(--gap); }
.greet .eyebrow { margin-bottom: 6px; }
.greet .email { color: var(--ft-text-dim); font-size: 0.95rem; }

.overview-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: 1.1fr 1fr;
}
@media (max-width: 860px) { .overview-grid { grid-template-columns: 1fr; } }

/* Big balance hero card */
.balance-hero {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 220px;
  background:
    radial-gradient(140% 120% at 110% -20%, rgba(255, 145, 0, 0.28), transparent 55%),
    var(--ft-panel-bg);
}
.balance-hero .glyph {
  position: absolute; right: -18px; bottom: -30px; font-size: 11rem; line-height: 1;
  color: rgba(255, 215, 0, 0.08); pointer-events: none; transform: rotate(-12deg);
  font-family: var(--font-display);
}
.balance-hero .amount {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2.6rem, 7vw, 4rem); line-height: 1;
  color: var(--ft-accent-soft); text-shadow: 0 4px 30px rgba(255, 145, 0, 0.4);
  margin: 6px 0;
}
.balance-hero .amount small { font-size: 1.1rem; color: var(--ft-text-dim); font-weight: 600; margin-left: 8px; }
.balance-hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

/* Operations list */
.oplist { display: flex; flex-direction: column; gap: 2px; }
.op {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 10px;
  transition: background 0.15s;
}
.op:hover { background: rgba(255, 215, 0, 0.05); }
.op + .op { border-top: 1px solid rgba(255, 215, 0, 0.08); }
.op-ico {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; font-size: 1rem; font-weight: 800;
  background: rgba(255, 215, 0, 0.08); border: 1px solid var(--ft-border-color);
}
.op-main { flex: 1 1 auto; min-width: 0; }
.op-reason { font-weight: 700; font-size: 0.92rem; text-transform: capitalize; }
.op-date { font-size: 0.76rem; color: var(--ft-text-dim); }
.op-amt { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; white-space: nowrap; }
.op-amt.credit { color: var(--ft-good); }
.op-amt.debit { color: var(--ft-bad); }

/* ============================ DONATE =================================== */
.cards-grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
}
.pack {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 12px;
  transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.25s;
}
.pack:hover { transform: translateY(-5px); border-color: var(--ft-border-strong); box-shadow: var(--shadow-panel), var(--glow-orange); }
.pack .pack-title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.18rem; letter-spacing: 0.02em;
}
.pack .pack-bonus {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.9rem; color: var(--ft-accent-soft); line-height: 1;
  text-shadow: 0 2px 14px rgba(255,145,0,0.3);
}
.pack .pack-bonus small { font-size: 0.85rem; color: var(--ft-text-dim); font-weight: 600; }
.pack .pack-price {
  font-size: 1.05rem; font-weight: 700; color: var(--ft-text-light);
}
.pack .pack-price .rub { color: var(--ft-text-dim); font-weight: 400; }
.pack-foot { margin-top: auto; }
.benefit-badge {
  position: absolute; top: 14px; right: 14px;
  padding: 4px 11px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 700; font-size: 0.82rem;
  background: linear-gradient(135deg, var(--ft-secondary), var(--ft-secondary-soft));
  color: #fff; box-shadow: 0 4px 12px -4px rgba(128,0,128,0.7);
  border: 1px solid rgba(255,255,255,0.18);
}
.benefit-badge.hot {
  background: linear-gradient(135deg, var(--ft-primary), var(--ft-accent));
  color: #2a1102;
}

/* ============================ SHOP ===================================== */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: var(--gap);
}
.chip-filter {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.85rem;
  color: var(--ft-text-dim); background: rgba(255,215,0,0.04);
  border: 1px solid var(--ft-border-color);
  transition: all 0.18s; cursor: pointer;
}
.chip-filter:hover { color: var(--ft-text-light); border-color: var(--ft-border-strong); }
.chip-filter.is-active {
  color: #2a1102; background: linear-gradient(135deg, var(--ft-primary), var(--ft-accent));
  border-color: transparent; box-shadow: 0 6px 16px -8px rgba(255,145,0,0.7);
}

.offer { display: flex; flex-direction: column; gap: 10px; transition: transform 0.2s, box-shadow 0.25s, border-color 0.25s; }
.offer:hover { transform: translateY(-5px); border-color: var(--ft-border-strong); box-shadow: var(--shadow-panel), var(--glow-orange); }
.offer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.offer-title { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; line-height: 1.2; }
.offer-desc { font-size: 0.9rem; color: var(--ft-text-dim); flex: 1 1 auto; }
.offer-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.offer-price {
  font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; color: var(--ft-accent-soft);
  display: inline-flex; align-items: baseline; gap: 5px;
}
.offer-price .unit { font-size: 0.78rem; color: var(--ft-text-dim); font-weight: 600; }
.cat-tag {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ft-secondary-soft); font-weight: 700;
  padding: 3px 9px; border-radius: 6px; background: rgba(128,0,128,0.22);
  border: 1px solid rgba(177,79,177,0.4);
}

/* ============================ HISTORY ================================== */
.histcols { display: grid; gap: var(--gap); grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .histcols { grid-template-columns: 1fr; } }
.redeem {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px;
  transition: background 0.15s;
}
.redeem:hover { background: rgba(255,215,0,0.05); }
.redeem + .redeem { border-top: 1px solid rgba(255,215,0,0.08); }
.redeem-main { flex: 1 1 auto; min-width: 0; }
.redeem-title { font-weight: 700; font-size: 0.92rem; }
.redeem-sub { font-size: 0.76rem; color: var(--ft-text-dim); }
.delivery-pill {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.delivery-pill.pending { color: var(--ft-warn); background: rgba(255,179,71,0.14); border: 1px solid rgba(255,179,71,0.4); }
.delivery-pill.delivered { color: var(--ft-good); background: rgba(95,209,122,0.14); border: 1px solid rgba(95,209,122,0.4); }
.delivery-pill.failed { color: var(--ft-bad); background: rgba(255,107,107,0.14); border: 1px solid rgba(255,107,107,0.4); }

/* status dot for servers */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.online { background: var(--ft-good); box-shadow: 0 0 8px var(--ft-good); }
.dot.maintenance { background: var(--ft-warn); box-shadow: 0 0 8px var(--ft-warn); }
.dot.offline { background: var(--ft-bad); }

/* ============================ MODAL ==================================== */
.modal-root {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 18px;
  background: rgba(5, 1, 10, 0.74); backdrop-filter: blur(5px);
  animation: fade 0.2s ease;
}
.modal {
  width: min(480px, 100%);
  animation: rise 0.35s cubic-bezier(.2,.8,.2,1) both;
  max-height: 92vh; overflow-y: auto;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.modal-close {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--ft-border-color);
  background: rgba(255,215,0,0.05); color: var(--ft-text-light); font-size: 1.1rem; line-height: 1;
  display: grid; place-items: center; transition: all 0.18s;
}
.modal-close:hover { background: rgba(255,107,107,0.2); border-color: rgba(255,107,107,0.5); }
.modal .confirm-line {
  margin: 14px 0 4px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(255, 145, 0, 0.1); border: 1px solid var(--ft-border-color);
  font-weight: 700;
}
.modal .confirm-line b { color: var(--ft-accent-soft); font-family: var(--font-display); }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1 1 auto; }

/* ============================ TOASTS =================================== */
.toast-stack {
  position: fixed; right: 18px; bottom: 18px; z-index: 80;
  display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 36px));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 15px; border-radius: 12px;
  background: var(--ft-panel-bg-2); backdrop-filter: blur(8px);
  border: 1px solid var(--ft-border-color);
  box-shadow: 0 14px 34px -16px rgba(0,0,0,0.85);
  animation: toastIn 0.35s cubic-bezier(.2,.8,.2,1) both;
  font-size: 0.9rem;
}
.toast.out { animation: toastOut 0.3s ease forwards; }
.toast .t-ico { flex: 0 0 auto; font-size: 1.05rem; }
.toast.ok { border-color: rgba(95,209,122,0.5); }
.toast.ok .t-ico { color: var(--ft-good); }
.toast.err { border-color: rgba(255,107,107,0.5); }
.toast.err .t-ico { color: var(--ft-bad); }
.toast.info .t-ico { color: var(--ft-accent); }
.toast a { color: var(--ft-accent); font-weight: 700; text-decoration: underline; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(0.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px) scale(0.96); } }

/* ============================ STATES =================================== */
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid rgba(255, 215, 0, 0.18); border-top-color: var(--ft-primary);
  animation: spin 0.8s linear infinite; margin: 30px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center-state {
  text-align: center; padding: clamp(30px, 8vh, 70px) 18px; color: var(--ft-text-dim);
}
.center-state .big { font-size: 2.4rem; margin-bottom: 8px; opacity: 0.7; }
.empty {
  text-align: center; padding: 30px 14px; color: var(--ft-text-dim); font-size: 0.92rem;
}
.empty .big { font-size: 2rem; opacity: 0.6; margin-bottom: 6px; }

/* skeleton shimmer */
.skel {
  border-radius: 10px;
  background: linear-gradient(100deg, rgba(255,215,0,0.04) 30%, rgba(255,215,0,0.12) 50%, rgba(255,215,0,0.04) 70%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite;
}
.skel.card { height: 168px; }
.skel.line { height: 14px; margin: 8px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ------------------------------ FOOTER --------------------------------- */
.sitefoot {
  position: relative; z-index: 1; text-align: center;
  padding: 22px 18px 30px; color: var(--ft-text-dim); font-size: 0.82rem;
  letter-spacing: 0.04em;
}
.sitefoot a { color: var(--ft-accent); }
.sitefoot a:hover { text-decoration: underline; }
.sitefoot-sep { margin: 0 8px; opacity: 0.5; }

/* ------------------------------ ANIM ----------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes fade { from { opacity: 0; } }
.stagger > * { animation: rise 0.5s cubic-bezier(.2,.8,.2,1) both; }
.stagger > *:nth-child(1) { animation-delay: 0.03s; }
.stagger > *:nth-child(2) { animation-delay: 0.08s; }
.stagger > *:nth-child(3) { animation-delay: 0.13s; }
.stagger > *:nth-child(4) { animation-delay: 0.18s; }
.stagger > *:nth-child(5) { animation-delay: 0.23s; }
.stagger > *:nth-child(6) { animation-delay: 0.28s; }
.stagger > *:nth-child(7) { animation-delay: 0.33s; }
.stagger > *:nth-child(8) { animation-delay: 0.38s; }
@media (prefers-reduced-motion: reduce) {
  .stagger > *, .auth-card, .modal, .toast { animation: none !important; }
}

/* ------------------------- RESPONSIVE NAV ------------------------------ */
@media (max-width: 720px) {
  .brand-text small { display: none; }
  .balance-chip__lbl { display: none; }
  .navmenu-toggle {
    display: inline-flex; flex-direction: column; gap: 4px; justify-content: center;
    width: 40px; height: 38px; border-radius: 10px; padding: 0 9px;
    background: rgba(255,215,0,0.05); border: 1px solid var(--ft-border-color);
  }
  .navmenu-toggle span { display: block; height: 2px; background: var(--ft-accent); border-radius: 2px; transition: transform 0.25s, opacity 0.2s; }
  .navmenu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .navmenu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .navmenu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .mainnav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 2px; margin: 0; padding: 8px;
    background: rgba(17, 3, 26, 0.98); border-bottom: 1px solid var(--ft-border-color);
    box-shadow: 0 18px 30px -18px rgba(0,0,0,0.9);
    transform-origin: top; transform: scaleY(0); opacity: 0;
    transition: transform 0.22s ease, opacity 0.18s;
  }
  .mainnav.open { transform: scaleY(1); opacity: 1; }
  .mainnav a { padding: 12px 14px; }
  .mainnav a::after { display: none; }
  .btn--logout, .btn--home { display: none; } /* live in the dropdown when collapsed */
  .mainnav .nav-logout { display: block; color: var(--ft-bad); border-top: 1px solid var(--ft-border-color); margin-top: 4px; }
  .mainnav .nav-home { display: block; color: var(--ft-accent); border-top: 1px solid var(--ft-border-color); margin-top: 4px; }
}
@media (min-width: 721px) {
  .mainnav .nav-logout, .mainnav .nav-home { display: none; }
}

/* Payment methods block (provider-neutral; PayAnyWay branding added at go-live) */
.rk-pay {
  margin: 6px 0 calc(var(--gap) * 0.6);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.rk-pay-logo {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.rk-pay-logo:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.5);
}
.rk-pay-logo img { display: block; height: 24px; width: auto; }
.rk-pay-methods {
  max-width: 62ch;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--ft-text-dim);
}
.rk-pay-methods a { color: var(--ft-text); }
.rk-pay-security {
  max-width: 62ch;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ft-text-dim);
  opacity: 0.85;
}

/* ===================== ИГРА ДНЯ — «Найди пару» ===================== */
.btn--sm { padding: 7px 14px; font-size: 0.78rem; }

.mg-banner {
  margin: 6px 0 14px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(255,145,0,0.14), rgba(255,215,0,0.07));
  box-shadow: inset 0 0 0 1px var(--ft-border-color);
  color: var(--ft-text-light);
  font-size: 0.92rem;
}
.mg-banner.is-done {
  background: linear-gradient(135deg, rgba(128,0,128,0.18), rgba(177,79,177,0.08));
}

.mg-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.mg-stats { display: flex; gap: 16px; flex-wrap: wrap; }
.mg-stat {
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
  color: var(--ft-accent-soft); letter-spacing: 0.02em;
}

.mg-stage { width: 100%; max-width: 920px; margin: 0 auto; }

.mg-board {
  position: relative;
  width: 100%;
  aspect-ratio: 1448 / 1086;             /* matches board.png — cards land on slots */
  background: url("assets/game/board.png") center / contain no-repeat;
  filter: drop-shadow(0 22px 44px rgba(0,0,0,0.6));
}

.mg-card {
  position: absolute;
  cursor: pointer;
  perspective: 800px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none; -webkit-user-select: none;
}
.mg-card__inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.mg-card.is-flipped .mg-card__inner,
.mg-card.is-matched .mg-card__inner { transform: rotateY(180deg); }

.mg-face {
  position: absolute; inset: 0;
  background-repeat: no-repeat; background-position: center; background-size: contain;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.mg-face--front { transform: rotateY(180deg); }

/* gentle lift on hover for unsolved cards (desktop / fine pointers) */
@media (hover: hover) and (pointer: fine) {
  .mg-card:not(.is-matched):not(.is-flipped):hover { transform: translateY(-3px); transition: transform .15s ease; }
}

/* matched pair: soft golden glow + settle */
.mg-card.is-matched { cursor: default; }
.mg-card.is-matched .mg-face--front {
  filter: drop-shadow(0 0 9px rgba(255, 215, 0, 0.65));
  animation: mg-pop 0.45s ease;
}
@keyframes mg-pop { 0% { transform: rotateY(180deg) scale(1); } 45% { transform: rotateY(180deg) scale(1.06); } 100% { transform: rotateY(180deg) scale(1); } }

/* victory overlay */
.mg-win {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 45%, rgba(17,3,26,0.55), rgba(17,3,26,0.86));
  border-radius: var(--radius);
  animation: mg-fade 0.35s ease;
}
@keyframes mg-fade { from { opacity: 0; } to { opacity: 1; } }
.mg-win__card {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: clamp(20px, 4vw, 34px) clamp(24px, 5vw, 44px);
  text-align: center;
  background: var(--ft-panel-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel), 0 0 0 1px var(--ft-border-strong);
  backdrop-filter: blur(3px);
  max-width: 86%;
}
.mg-win__crest { font-size: 2.4rem; color: var(--ft-accent); filter: drop-shadow(0 0 14px rgba(255,215,0,0.6)); }
.mg-win__title { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--ft-text-light); }
.mg-win__msg { font-size: 0.98rem; }
.mg-win__reward { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--ft-good); }

@media (max-width: 560px) {
  .mg-stat { font-size: 0.85rem; }
  .mg-win__title { font-size: 1.2rem; }
}
