/* VIP-клуб (src/vip.js): знак у имени, титулы-ступени, клубные рамки и облачка, вход за стол,
   страница /vip, праздничное окно уровня и полоска в кассе. Подключён везде (head.ejs), и в комнате тоже. */

@property --vip-spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
@keyframes vip-spin { to { --vip-spin: 360deg; } }
@keyframes vip-sheen { to { background-position: -200% 0; } }
@keyframes vip-pulse { 0%, 100% { box-shadow: 0 0 0 1px rgba(255, 226, 160, 0.45) inset, 0 0 10px rgba(243, 184, 87, 0.25); } 50% { box-shadow: 0 0 0 1px rgba(255, 236, 190, 0.8) inset, 0 0 18px rgba(243, 184, 87, 0.55); } }

/* ---------- знак у имени ---------- */

.vip-badge {
  --vip-ink: #e9cf96;
  --vip-bg: rgba(217, 183, 122, 0.12);
  --vip-line: rgba(217, 183, 122, 0.45);
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 3px;
  height: 18px;
  padding: 0 7px 0 5px;
  border-radius: 999px;
  vertical-align: middle;
  font-family: var(--sans, system-ui, sans-serif);
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  color: var(--vip-ink);
  background: var(--vip-bg);
  box-shadow: 0 0 0 1px var(--vip-line) inset;
}
.vip-badge svg { width: 12px; height: 12px; flex: none; }
.vip-badge b { font-weight: 800; }
a.vip-badge:hover { filter: brightness(1.12); }
.vip-badge[data-vip="3"], .vip-badge[data-vip="4"] {
  --vip-ink: #f7e2b4;
  --vip-bg: linear-gradient(135deg, rgba(142, 27, 58, 0.55), rgba(60, 10, 26, 0.7));
  --vip-line: rgba(241, 217, 166, 0.6);
}
.vip-badge[data-vip="5"], .vip-badge[data-vip="6"] {
  --vip-ink: #1b1206;
  --vip-bg: linear-gradient(135deg, #f7e2b4 0%, #d9b77a 45%, #9c7438 100%);
  --vip-line: rgba(255, 244, 214, 0.55);
  box-shadow: 0 0 0 1px var(--vip-line) inset, 0 2px 8px rgba(243, 184, 87, 0.25);
}
.vip-badge[data-vip="7"], .vip-badge[data-vip="8"], .vip-badge[data-vip="9"] {
  --vip-ink: #1b1206;
  --vip-bg: linear-gradient(110deg, #c79a45 0%, #fff1c9 30%, #e3b85c 50%, #fff1c9 70%, #c79a45 100%) 0 0 / 200% 100%;
  animation: vip-sheen 3.6s linear infinite, vip-pulse 3.6s ease-in-out infinite;
}
.vip-badge[data-vip="7"] svg, .vip-badge[data-vip="8"] svg, .vip-badge[data-vip="9"] svg { color: #8e1b3a; }
.vip-badge.is-crown {
  --vip-ink: #fff1c9;
  --vip-bg: radial-gradient(120% 140% at 30% 0%, rgba(255, 255, 255, 0.14), transparent 60%), linear-gradient(135deg, #6e1030, #2a0714);
  padding: 0 8px 0 6px;
  box-shadow: 0 0 0 1px rgba(255, 226, 160, 0.8) inset, 0 0 14px rgba(243, 184, 87, 0.45), 0 0 26px rgba(196, 42, 82, 0.35);
  animation: vip-pulse 3s ease-in-out infinite;
}
.vip-badge.is-crown svg { width: 14px; height: 14px; color: #f3c868; filter: drop-shadow(0 0 4px rgba(255, 214, 130, 0.8)); }
.vip-badge.is-crown b {
  background: linear-gradient(90deg, #f3b857, #fff1c9 40%, #e3a93a 60%, #f3b857) 0 0 / 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: vip-sheen 3s linear infinite;
}
html[data-theme="light"] .vip-badge[data-vip="1"], html[data-theme="light"] .vip-badge[data-vip="2"] {
  --vip-ink: #7a5624;
  --vip-bg: rgba(156, 116, 56, 0.12);
  --vip-line: rgba(156, 116, 56, 0.5);
}

/* ---------- имя светится (уровень 6+) ---------- */

.vip-glow,
.rm-seat.is-vip-glow .rm-seat-name {
  color: #ffe7b0;
  text-shadow: 0 0 2px rgba(255, 236, 190, 0.55), 0 0 10px rgba(243, 184, 87, 0.55);
  animation: vip-name-glow 3.4s ease-in-out infinite;
}
.vip-glow a, a.vip-glow { color: inherit; }
@keyframes vip-name-glow { 50% { text-shadow: 0 0 3px rgba(255, 244, 214, 0.8), 0 0 16px rgba(243, 184, 87, 0.8); } }
html[data-theme="light"] .vip-glow, html[data-theme="light"] .rm-seat.is-vip-glow .rm-seat-name { color: #8a5d12; }

/* ---------- за столом: знак на табличке места, вход гостя клуба ---------- */

.rm-seat-vip { position: absolute; top: -17px; right: -12px; z-index: 3; pointer-events: auto; }
.rm-seat-vip[hidden] { display: none; }
.rm-seat-vip .vip-badge { height: 16px; padding: 0 6px 0 4px; font-size: 9px; box-shadow: 0 0 0 1px var(--vip-line) inset, 0 3px 8px rgba(0, 0, 0, 0.5); }
.rm-seat-vip .vip-badge svg { width: 11px; height: 11px; }
.rm-seat.is-vip-entrance .rm-seat-frame { animation: vip-entrance 2.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.rm-seat.is-vip-entrance .rm-seat-halo { opacity: 1; animation: vip-entrance-halo 2.4s ease-out both; background: radial-gradient(circle, rgba(255, 228, 160, 0.65), rgba(243, 184, 87, 0.25) 45%, transparent 70%); }
@keyframes vip-entrance {
  0% { box-shadow: 0 0 0 0 rgba(255, 226, 160, 0.9), 0 0 0 0 rgba(243, 184, 87, 0.6); }
  35% { box-shadow: 0 0 0 6px rgba(255, 226, 160, 0.55), 0 0 60px 16px rgba(243, 184, 87, 0.55); }
  100% { box-shadow: 0 0 0 18px rgba(255, 226, 160, 0), 0 0 40px 0 rgba(243, 184, 87, 0); }
}
@keyframes vip-entrance-halo { 0% { transform: scale(0.6); opacity: 0; } 30% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.rm-msg.rm-msg-vip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #f1d9a6;
  background: linear-gradient(90deg, transparent, rgba(217, 183, 122, 0.16), transparent);
  border-radius: 10px;
}
.rm-msg.rm-msg-vip .vip-badge { flex: none; }
.rm-msg.rm-msg-vip .vip-badge svg { width: 12px; }
html[data-theme="light"] .rm-msg.rm-msg-vip { color: #7a5624; }

/* ---------- титулы-ступени: каждый ярче предыдущего ---------- */

:root .cos-title.cos-title--vip-3 { --title-ink: #e9cf96; }
:root .cos-title.cos-title--vip-3::before { content: "◆"; }
:root .cos-title.cos-title--vip-3::after { box-shadow: 0 0 0 1px rgba(233, 207, 150, 0.6) inset; }

:root .cos-title.cos-title--vip-4 { --title-ink: #f7e2b4; text-shadow: 0 0 10px rgba(243, 184, 87, 0.35); }
:root .cos-title.cos-title--vip-4::before { content: "❖"; color: #e5486b; text-shadow: 0 0 8px rgba(229, 72, 107, 0.6); }
:root .cos-title.cos-title--vip-4::after {
  background: linear-gradient(135deg, rgba(142, 27, 58, 0.6), rgba(40, 8, 20, 0.75));
  box-shadow: 0 0 0 1px rgba(241, 217, 166, 0.7) inset, 0 0 0 3px rgba(142, 27, 58, 0.25);
}

:root .cos-title.cos-title--vip-5::before { content: "❖"; }
:root .cos-title.cos-title--vip-5::after { box-shadow: 0 0 0 1px rgba(243, 184, 87, 0.75) inset, 0 0 12px rgba(243, 184, 87, 0.3); }

:root .cos-title.cos-title--vip-7::before,
:root .cos-title.cos-title--vip-8::before { content: "✷"; }
:root .cos-title.cos-title--vip-7::after,
:root .cos-title.cos-title--vip-8::after { animation: vip-pulse 3.2s ease-in-out infinite; }
:root .cos-title.cos-title--vip-8::before { color: #f0587a; }

:root .cos-title.cos-title--vip-9,
:root .cos-title.cos-title--vip-10 { animation-duration: 2.6s; }
:root .cos-title.cos-title--vip-9::before { content: "✷"; }
:root .cos-title.cos-title--vip-10::before { content: "♛"; font-size: 0.95em; color: #f3c868; text-shadow: 0 0 8px rgba(255, 214, 130, 0.9); }
:root .cos-title.cos-title--vip-9::after,
:root .cos-title.cos-title--vip-10::after {
  inset: -1px;
  padding: 1.5px;
  background: conic-gradient(from var(--vip-spin), #8a6a33, #fff1c9, #e3b85c, #c42a52, #fff1c9, #8a6a33);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  box-shadow: none;
  animation: vip-spin 4.5s linear infinite;
}
:root .cos-title.cos-title--vip-10 {
  filter: drop-shadow(0 0 6px rgba(243, 184, 87, 0.55)) drop-shadow(0 0 14px rgba(196, 42, 82, 0.3));
}
:root .cos-title.cos-title--vip-10::after { padding: 2px; animation-duration: 3s; }
.rm-seat-title.cos-title--vip-10 { color: #f7d98a; text-shadow: 0 0 10px rgba(243, 184, 87, 0.6); }
.rm-seat-title.cos-title--vip-9,
.rm-seat-title.cos-title--vip-7,
.rm-seat-title.cos-title--vip-8 { text-shadow: 0 0 8px rgba(243, 184, 87, 0.45); }

/* ---------- клубные рамки ---------- */

.cos-frame--vip-ring {
  --cos-w: 7.5%;
  --cos-ring: conic-gradient(from 0deg, #8a6a33, #f7e2b4 10%, #c79a45 18%, #8e1b3a 23%, #e5486b 27%, #8e1b3a 31%, #c79a45 36%, #fff1c9 50%, #9c7438 60%, #8e1b3a 73%, #e5486b 77%, #8e1b3a 81%, #c79a45 86%, #8a6a33);
  box-shadow: 0 0 14px rgba(229, 72, 107, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.4);
}
.cos-frame--vip-ring::after {
  inset: -13%;
  z-index: 3;
  border-radius: 50%;
  border: 1.5px dotted rgba(255, 233, 176, 0.7);
}

.cos-frame--vip-legend {
  --cos-w: 8%;
  --cos-ring:
    conic-gradient(from var(--cos-spin, 0deg), transparent 0deg 290deg, rgba(255, 255, 255, 0.95) 322deg, transparent 352deg),
    conic-gradient(from 90deg, #7a5624, #fff1c9, #e3b85c, #8a6a33, #ffe8a8, #c79a45, #7a5624);
  box-shadow: 0 0 20px rgba(243, 184, 87, 0.45), 0 0 54px rgba(243, 184, 87, 0.16);
  animation: cos-crown-glow 3.2s ease-in-out infinite;
}
.cos-frame--vip-legend::before { animation: cos-spin-ring 3s linear infinite; }
.cos-frame--vip-legend::after {
  inset: -14%;
  z-index: 3;
  border-radius: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><g fill='none' stroke-linecap='round'><circle cx='50' cy='50' r='44' stroke='%235d1022' stroke-width='7' stroke-dasharray='.01 23.0383'/><circle cx='50' cy='50' r='44' stroke='%23e5486b' stroke-width='5.2' stroke-dasharray='.01 23.0383'/><circle cx='50' cy='50' r='44.2' stroke='%23ffd5de' stroke-width='1.8' stroke-dasharray='.01 23.0383' transform='rotate(-1 50 50) translate(-.5 -.6)'/></g></svg>") center / 100% 100% no-repeat;
  filter: drop-shadow(0 0 3px rgba(229, 72, 107, 0.65));
  animation: cos-rotate 40s linear infinite;
}

.cos-frame--vip-patron {
  --cos-w: 9%;
  --cos-ring:
    conic-gradient(from var(--cos-spin, 0deg), transparent 0deg 300deg, rgba(255, 255, 255, 0.95) 330deg, transparent 360deg),
    conic-gradient(from 0deg, #fff1c9, #e3b85c 12%, #8e1b3a 22%, #e5486b 26%, #8e1b3a 30%, #e3b85c 40%, #fff1c9 50%, #c79a45 62%, #8e1b3a 72%, #e5486b 76%, #8e1b3a 80%, #e3b85c 90%, #fff1c9);
  box-shadow: 0 0 24px rgba(243, 184, 87, 0.55), 0 0 70px rgba(196, 42, 82, 0.28);
  animation: vip-patron-glow 3s ease-in-out infinite;
}
.cos-frame--vip-patron::before { animation: cos-spin-ring 3.4s linear infinite; }
.cos-frame--vip-patron::after {
  z-index: 3;
  left: 50%;
  top: -40%;
  width: 70%;
  height: 46%;
  border-radius: 0;
  transform: translateX(-50%);
  background: var(--cos-crown) center / contain no-repeat;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 10px rgba(255, 214, 130, 0.75));
  animation: vip-crown-float 3.4s ease-in-out infinite;
}
@keyframes vip-patron-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(243, 184, 87, 0.45), 0 0 60px rgba(196, 42, 82, 0.22); }
  50% { box-shadow: 0 0 32px rgba(255, 214, 130, 0.75), 0 0 96px rgba(196, 42, 82, 0.4); }
}
@keyframes vip-crown-float { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -7%); } }

.cos-frame--vip-garnet {
  --cos-w: 3%;
  --cos-ring: linear-gradient(135deg, #f1d9a6, #8a6a33);
  box-shadow: 0 0 14px rgba(142, 27, 58, 0.35);
}
.cos-frame--vip-garnet::after {
  inset: -15%;
  z-index: 3;
  border-radius: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><g fill='none' stroke-linecap='round'><circle cx='50' cy='50' r='44' stroke='%232a0610' stroke-width='7.4' stroke-dasharray='.01 9.2153'/><circle cx='50' cy='50' r='44' stroke='%237a1430' stroke-width='6.2' stroke-dasharray='.01 9.2153'/><circle cx='50' cy='50' r='44.3' stroke='%23e5486b' stroke-width='2.2' stroke-dasharray='.01 9.2153' transform='rotate(-1.4 50 50) translate(-.4 -.5)'/></g></svg>") center / 100% 100% no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  .cos-frame--vip-legend, .cos-frame--vip-legend::before, .cos-frame--vip-legend::after,
  .cos-frame--vip-patron, .cos-frame--vip-patron::before, .cos-frame--vip-patron::after,
  .vip-badge, .vip-badge b, .vip-glow, .rm-seat.is-vip-glow .rm-seat-name,
  :root .cos-title[class*="cos-title--vip-"], :root .cos-title[class*="cos-title--vip-"]::after { animation: none; }
}

/* ---------- клубные облачка ---------- */

.cos-bubble.cos-bubble--vip-club {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, 0.07), transparent 55%) padding-box,
    linear-gradient(160deg, #4d0c20, #22050f) padding-box,
    linear-gradient(135deg, #f7e2b4, #9c7438 45%, #e3b85c 70%, #7a5624) border-box;
  border: 1px solid transparent;
  --cos-bubble-ink: #f9ecd8;
  box-shadow: 0 10px 26px rgba(40, 4, 16, 0.45);
}
.cos-bubble.cos-bubble--vip-club::after {
  content: "✦";
  position: absolute;
  top: -8px;
  right: 10px;
  font-size: 11px;
  line-height: 1;
  color: #f1d9a6;
  text-shadow: 0 0 6px rgba(243, 184, 87, 0.8);
}
.cos-bubble.cos-bubble--vip-champagne {
  background:
    radial-gradient(circle at 12% 120%, rgba(255, 255, 255, 0.55) 0 1.5px, transparent 2.5px) 0 0 / 34px 30px,
    radial-gradient(circle at 70% 110%, rgba(255, 250, 230, 0.45) 0 1px, transparent 2px) 0 0 / 22px 26px,
    linear-gradient(165deg, #f3dfae, #c9a35d 55%, #a77d3a);
  --cos-bubble-ink: #261804;
  box-shadow: 0 0 0 1px rgba(255, 244, 214, 0.6) inset, 0 10px 24px rgba(120, 84, 30, 0.35);
  animation: vip-bubbles 6s linear infinite;
}
.cos-bubble.cos-bubble--vip-champagne a { color: #5b0f26; }
@keyframes vip-bubbles { to { background-position: 0 -60px, 0 -52px, 0 0; } }

.cos-fx-halo--vip { background: radial-gradient(circle, rgba(255, 236, 190, 0.55), rgba(243, 184, 87, 0.22) 38%, rgba(196, 42, 82, 0.12) 55%, transparent 70%); }

/* ---------- медальон уровня ---------- */

.vip-medal {
  --m: 92px;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--m);
  height: var(--m);
  border-radius: 50%;
  color: #1b1206;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.55), transparent 42%),
    conic-gradient(from 210deg, #8a6a33, #fff1c9, #e3b85c, #9c7438, #ffe8a8, #c79a45, #8a6a33);
  box-shadow: 0 0 0 3px rgba(20, 12, 6, 0.85), 0 0 0 4px rgba(241, 217, 166, 0.55), 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 40px rgba(243, 184, 87, 0.28);
}
.vip-medal::before {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, #7a1430, #3a0816 70%);
  box-shadow: 0 0 0 1.5px rgba(255, 241, 201, 0.75), 0 2px 6px rgba(0, 0, 0, 0.6) inset;
}
.vip-medal b {
  position: relative;
  font-family: var(--display);
  font-size: calc(var(--m) * 0.42);
  font-weight: 700;
  line-height: 1;
  /* Cormorant draws old-style figures (3, 4, 5, 7, 9 drop below the line, 6 and 8 rise): lining figures sit centred in the medal */
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  background: linear-gradient(180deg, #fff4d6, #e3b85c 60%, #b8893c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.6));
}
.vip-medal .ico {
  position: absolute;
  top: calc(var(--m) * -0.26);
  left: 50%;
  width: calc(var(--m) * 0.46);
  height: calc(var(--m) * 0.46);
  transform: translateX(-50%);
  color: #f3c868;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 8px rgba(255, 214, 130, 0.7));
}
.vip-medal.is-sm { --m: 46px; box-shadow: 0 0 0 2px rgba(20, 12, 6, 0.85), 0 0 0 3px rgba(241, 217, 166, 0.45), 0 6px 16px rgba(0, 0, 0, 0.45); }
.vip-medal.is-lg { --m: 116px; }
.vip-medal[data-vip="0"] { filter: grayscale(0.9) brightness(0.7); }
.vip-medal[data-vip="10"] { animation: vip-medal-glow 3s ease-in-out infinite; }
@keyframes vip-medal-glow { 50% { box-shadow: 0 0 0 3px rgba(20, 12, 6, 0.85), 0 0 0 4px rgba(255, 236, 190, 0.85), 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 70px rgba(243, 184, 87, 0.55); } }

/* ---------- страница /vip ---------- */

.page-vip { padding: 0 0 72px; }
.vip-hero {
  position: relative;
  isolation: isolate;
  margin: calc(-1 * var(--nav-h, 64px)) 0 36px;
  padding-top: var(--nav-h, 64px);
  overflow: hidden;
}
.vip-hero-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
.vip-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(7, 6, 10, 0.92) 0%, rgba(7, 6, 10, 0.6) 46%, rgba(7, 6, 10, 0.25) 100%),
    linear-gradient(180deg, transparent 55%, var(--bg) 100%);
}
.vip-hero-in {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.85fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  max-width: var(--wide, 1200px);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 84px) var(--page-x, 20px) clamp(40px, 5vw, 64px);
}
.vip-hero-copy { display: grid; gap: 14px; }
.vip-hero-copy h1 { margin: 0; max-width: 16ch; }
.vip-hero-copy .lede { margin: 0; }
.vip-hero .eyebrow { color: #e7c98d; }
.vip-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.vip-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 34px 26px 26px;
  border-radius: var(--r-lg, 22px);
  text-align: center;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(217, 183, 122, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(40, 24, 30, 0.86), rgba(16, 10, 14, 0.9));
  border: 1px solid rgba(217, 183, 122, 0.4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  backdrop-filter: blur(10px);
}
.vip-card .vip-medal { margin-bottom: 6px; }
.vip-card[data-vip="10"] .vip-medal { margin-top: 18px; }
.vip-card-eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.vip-card-name {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(28px, 3vw, 36px);
  font-weight: 600;
  line-height: 1.05;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.vip-card-sum { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.vip-card-sum b { color: var(--ink); }
.vip-card-bonus {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(95, 207, 152, 0.12);
  color: #8fe0b5;
  font-size: 13px;
  font-weight: 700;
}
.vip-card-bonus .ico { width: 15px; height: 15px; }
.vip-progress {
  width: 100%;
  height: 10px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 1px rgba(217, 183, 122, 0.25) inset;
  overflow: hidden;
}
.vip-progress span {
  display: block;
  width: var(--pct, 0%);
  min-width: 6px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9c7438, #f7e2b4 70%, #fff4d6);
  box-shadow: 0 0 12px rgba(243, 184, 87, 0.6);
}
.vip-card-next { margin: 2px 0 0; color: var(--ink-2); font-size: 13.5px; }
.vip-card-next b { color: var(--gold-2); }
.vip-card-next.is-top { color: var(--gold-2); font-family: var(--display); font-style: italic; font-size: 17px; }
.vip-card-note { margin: 0; color: var(--muted); font-size: 12px; }
.vip-card.is-guest .btn { margin-top: 8px; }

.vip-shell { display: grid; gap: 56px; max-width: var(--wide, 1200px); margin: 0 auto; padding: 0 var(--page-x, 20px); }
.vip-section-head { display: grid; gap: 6px; margin-bottom: 20px; }
.vip-section-head h2 { margin: 0; font-family: var(--display); font-size: clamp(28px, 3vw, 38px); font-weight: 600; }
.vip-section-head .muted { margin: 0; max-width: 70ch; }

.vip-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.vip-action {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 20px 22px;
  border-radius: var(--r-md, 16px);
  background: var(--surface);
  border: 1px solid var(--line);
}
.vip-action h3 { margin: 0; font-size: 17px; }
.vip-action p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.vip-action .btn { justify-self: start; margin-top: 4px; }
.vip-action-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(217, 183, 122, 0.13); color: var(--gold); }
.vip-action-ico .ico { width: 20px; height: 20px; }
.vip-action-demo { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); }
.vip-action-demo b { color: var(--ink); }
.vip-action-later { display: inline-flex; align-items: center; gap: 6px; color: var(--muted) !important; font-size: 13px !important; }
.vip-action-later .ico { width: 15px; height: 15px; }
.vip-action-later.is-bad, .vip-action-result.is-bad { color: #ef7d95 !important; }
.vip-action-result { color: #7ad3a0 !important; font-size: 13px !important; }
.vip-weekly.is-ready { border-color: rgba(217, 183, 122, 0.55); box-shadow: 0 0 0 1px rgba(217, 183, 122, 0.25), 0 14px 40px rgba(217, 183, 122, 0.12); }
.vip-title-form { display: flex; gap: 8px; margin-top: 4px; }
.vip-title-form input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border-radius: 10px; border: 0; background: var(--field); box-shadow: 0 0 0 1px var(--line) inset; color: var(--ink); font: inherit; }
.switch-row { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; cursor: pointer; }
.switch-row input { width: 18px; height: 18px; accent-color: #d9b77a; }

.vip-ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: none; }
.vip-step { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 0 18px; padding-bottom: 16px; }
.vip-step-rail { position: relative; display: flex; justify-content: center; padding-top: 18px; }
.vip-step-rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: -16px;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(180deg, rgba(217, 183, 122, 0.5), rgba(217, 183, 122, 0.12));
}
.vip-step:first-child .vip-step-rail::before { top: 40px; }
.vip-step:last-child .vip-step-rail::before { display: none; }
.vip-step-rail .vip-medal { position: relative; z-index: 1; }
.vip-step-card {
  display: grid;
  gap: 12px;
  padding: 18px 22px 20px;
  border-radius: var(--r-md, 16px);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.vip-step-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.vip-step-head h3 { margin: 0; font-family: var(--display); font-size: 26px; font-weight: 600; line-height: 1.1; }
.vip-step-rub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.vip-step-rub b { color: var(--ink-2); }
.vip-chip { display: inline-flex; padding: 3px 9px; border-radius: 999px; background: rgba(95, 207, 152, 0.12); color: #8fe0b5; font-size: 12px; font-weight: 800; }
.vip-step-tag { display: inline-flex; flex: none; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; }
.vip-step-tag .ico { width: 14px; height: 14px; }
.vip-step-tag.is-done { color: #8fe0b5; background: rgba(95, 207, 152, 0.1); }
.vip-step-tag.is-current { color: #1b1206; background: var(--grad-gold); box-shadow: 0 6px 18px rgba(243, 184, 87, 0.3); }
.vip-step-tag.is-next { color: var(--gold-2); box-shadow: 0 0 0 1px rgba(217, 183, 122, 0.5) inset; }
.vip-step-tag.is-locked { padding: 6px; color: var(--faint); background: rgba(255, 255, 255, 0.04); }
.vip-perk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.vip-perk-list li { position: relative; padding-left: 22px; color: var(--ink-2); font-size: 14.5px; line-height: 1.45; }
.vip-perk-list li::before { content: "✦"; position: absolute; left: 2px; top: 0; color: var(--gold); font-size: 12px; line-height: 1.7; }
.vip-perk-list.is-compact { justify-items: start; text-align: left; }
.vip-step-badge { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 13px; }
.vip-step.is-current .vip-step-card {
  border-color: rgba(217, 183, 122, 0.65);
  background: radial-gradient(120% 120% at 0% 0%, rgba(217, 183, 122, 0.16), transparent 55%), var(--surface);
  box-shadow: 0 0 0 1px rgba(217, 183, 122, 0.3), 0 18px 50px rgba(217, 183, 122, 0.12);
}
.vip-step.is-current .vip-medal { box-shadow: 0 0 0 2px rgba(20, 12, 6, 0.85), 0 0 0 3px rgba(255, 236, 190, 0.85), 0 0 26px rgba(243, 184, 87, 0.6); }
.vip-step.is-next .vip-step-card { border-color: rgba(217, 183, 122, 0.32); border-style: dashed; }
.vip-step.is-locked .vip-medal { filter: grayscale(0.75) brightness(0.65); }
.vip-step.is-locked .vip-step-head h3 { color: var(--ink-2); }
.vip-step.is-done .vip-step-rail::before { background: linear-gradient(180deg, #e3b85c, #b8893c); }

.vip-step-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.vip-step-items.is-compact { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); width: 100%; margin: 4px 0 8px; }
.vip-item { display: grid; grid-template-rows: auto auto; gap: 6px; margin: 0; min-width: 0; }
.vip-item-art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 35%, rgba(217, 183, 122, 0.14), transparent 65%), #0c0a10;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--rar, #d9b77a) 45%, transparent) inset;
}
.vip-item[data-rarity="rare"] { --rar: #5b9dff; }
.vip-item[data-rarity="epic"] { --rar: #b26bff; }
.vip-item[data-rarity="legendary"] { --rar: #f3b857; }
.vip-item[data-rarity="legendary"] .vip-item-art { box-shadow: 0 0 0 1px rgba(243, 184, 87, 0.6) inset, 0 0 18px rgba(243, 184, 87, 0.15); }
.vip-item-art .thumb { width: 100%; height: 100%; min-height: 0; background: transparent; }
.vip-item-art .thumb--frame .cos-portrait { --size: 52%; width: 52%; height: 52%; }
/* the patron frame wears a crown above the ring: lower it so the crown stays inside the tile */
.vip-item-art .thumb--frame .cos-portrait:has(.cos-frame--vip-patron) { margin-top: 12%; }
.vip-step-items { align-items: start; }
.vip-item[data-slot="plaque"] .vip-item-art { padding: 8px; }
.vip-item[data-slot="plaque"] .vip-item-art .thumb img { object-fit: contain; }
.vip-item-art.is-title { padding: 8px; }
.vip-item-art.is-title .cos-title { white-space: normal; text-align: center; justify-content: center; font-size: 14px; }
/* long titles with an icon («Покровитель салона») ran past the tile: the pill never grows wider than the tile */
.vip-item-art.is-title .cos-title { max-width: 100%; box-sizing: border-box; min-width: 0; overflow-wrap: anywhere; font-size: 13px; padding-left: 9px; padding-right: 9px; }
.vip-item figcaption, .vip-item-cap { display: grid; gap: 1px; min-width: 0; }
.vip-item figcaption b, .vip-item-cap b { font-size: 13px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.vip-item figcaption small, .vip-item-cap small { color: var(--muted); font-size: 11.5px; }
/* /vip: a tile is a button that opens the big preview (public/js/item-zoom.js) */
button.vip-item { width: 100%; padding: 0; border: 0; border-radius: 12px; background: none; color: inherit; font: inherit; text-align: left; cursor: zoom-in; -webkit-tap-highlight-color: transparent; }
button.vip-item .vip-item-art { transition: transform var(--dur-2, 180ms) var(--ease, ease), box-shadow var(--dur-2, 180ms) var(--ease, ease); }
button.vip-item:hover .vip-item-art, button.vip-item:focus-visible .vip-item-art { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--rar, #d9b77a) inset, 0 0 22px color-mix(in srgb, var(--rar, #d9b77a) 28%, transparent), 0 12px 24px rgba(0, 0, 0, 0.28); }
button.vip-item:active .vip-item-art { transform: translateY(-1px) scale(0.98); }
button.vip-item:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  button.vip-item .vip-item-art { transition: none; }
}
.vip-item-sparks .vip-item-art { gap: 2px; align-content: center; color: var(--gold); }
.vip-item-sparks .vip-item-art .ico { width: 30px; height: 30px; }
.vip-item-sparks .vip-item-art b { font-size: 11.5px; color: var(--ink-2); }
.vip-step-items.is-pool { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

.vip-hall-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.vip-hall-list a { display: grid; justify-items: center; gap: 10px; padding: 34px 12px 18px; border-radius: var(--r-md, 16px); background: var(--surface); border: 1px solid rgba(217, 183, 122, 0.3); color: inherit; text-decoration: none; text-align: center; }
.vip-hall-list b { font-size: 15px; }
.vip-hall-empty { display: flex; align-items: center; gap: 12px; margin: 0; padding: 22px 24px; border-radius: var(--r-md, 16px); border: 1px dashed rgba(217, 183, 122, 0.35); color: var(--ink-2); font-family: var(--display); font-style: italic; font-size: 19px; }
.vip-hall-empty .ico { width: 28px; height: 28px; flex: none; color: var(--gold); }

.vip-faq { display: grid; gap: 10px; }
.vip-faq .vip-section-head { margin-bottom: 10px; }
.vip-faq details { border-radius: var(--r-md, 16px); background: var(--surface); border: 1px solid var(--line); }
.vip-faq summary { padding: 16px 20px; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.vip-faq summary::-webkit-details-marker { display: none; }
.vip-faq summary::after { content: "+"; color: var(--gold); font-size: 20px; line-height: 1; }
.vip-faq details[open] summary::after { content: "–"; }
.vip-faq details p { margin: 0; padding: 0 20px 18px; color: var(--ink-2); line-height: 1.6; }

.vip-reveal .dialog-box { text-align: center; }
.vip-reveal-art { display: grid; place-items: center; width: 148px; height: 148px; margin: 6px auto 4px; border-radius: 18px; overflow: hidden; background: #0c0a10; box-shadow: 0 0 0 1px rgba(243, 184, 87, 0.5) inset, 0 0 40px rgba(243, 184, 87, 0.2); }
.vip-reveal-art .thumb { width: 100%; height: 100%; }
.vip-reveal-sparks { font-size: 64px; color: #f3c868; text-shadow: 0 0 24px rgba(243, 184, 87, 0.8); }

/* ---------- праздничное окно уровня ---------- */

.vip-up .vip-up-box {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: 520px;
  max-height: calc(100dvh - 32px);
  padding-top: 44px;
  overflow-x: hidden;
  overflow-y: auto;
  text-align: center;
  background: radial-gradient(120% 70% at 50% 0%, rgba(217, 183, 122, 0.24), transparent 62%), var(--surface-solid, #16121a);
  border: 1px solid rgba(217, 183, 122, 0.45);
}
.vip-up-rays {
  position: absolute;
  top: -180px;
  left: 50%;
  z-index: 0;
  width: 520px;
  height: 520px;
  margin-left: -260px;
  border-radius: 50%;
  background: repeating-conic-gradient(from var(--vip-spin), rgba(255, 226, 160, 0.12) 0 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 65%);
  mask: radial-gradient(circle, #000 20%, transparent 65%);
  animation: vip-spin 24s linear infinite;
  pointer-events: none;
}
.vip-up .vip-up-box > :not(.vip-up-rays) { position: relative; z-index: 1; }
.vip-up .vip-medal { margin-bottom: 8px; animation: vip-pop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.vip-up .dialog-title { font-family: var(--display); font-size: clamp(30px, 5vw, 40px); background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.vip-up .dialog-actions { justify-content: center; }
.vip-step-items.is-compact .vip-item-art.is-title { padding: 6px; }
.vip-step-items.is-compact .vip-item-art.is-title .cos-title { font-size: 12px; padding: 3px 8px 4px 7px; gap: 5px; }
.vip-up-more { margin: 0; color: var(--muted); font-size: 13px; }
.vip-up .vip-step-items.is-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@keyframes vip-pop { from { transform: scale(0.3) rotate(-25deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- касса: полоска клуба и бонус на пакетах ---------- */

.spk-vip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px 12px;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(142, 27, 58, 0.32), rgba(20, 10, 14, 0.4));
  border: 1px solid rgba(217, 183, 122, 0.35);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.spk-vip:hover { border-color: rgba(217, 183, 122, 0.65); transform: translateY(-1px); }
.spk-vip .vip-medal { --m: 40px; grid-row: 1 / 4; }
.page-sparks .spk-vip-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13.5px !important; font-weight: 700 !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--ink) !important; }
.spk-vip .vip-progress { height: 6px; margin: 0; }
.spk-vip small { color: var(--ink-2); font-size: 12.5px; }
.spk-vip-bonus { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 4px 10px; border-radius: 999px; background: rgba(217, 183, 122, 0.14); box-shadow: 0 0 0 1px rgba(217, 183, 122, 0.4) inset; color: #f1d9a6; font-size: 12.5px; font-weight: 800; justify-self: start; }
.spk-vip-bonus .ico { width: 14px; height: 14px; }
.spk-pay-vip { display: block; color: #8fe0b5; font-size: 12px; font-weight: 700; }
/* .spk-balance красит все свои span/b как подписи и крупную сумму — внутри полоски клуба возвращаем своё */
.page-sparks .spk-balance .vip-medal b { font-size: calc(var(--m) * 0.42); font-weight: 700; }
.page-sparks .spk-balance .vip-badge { font-size: 10px; letter-spacing: 0.06em; color: var(--vip-ink); }
.page-sparks .spk-balance .vip-badge:not(.is-crown) b { font: inherit; background: none; -webkit-background-clip: border-box; background-clip: border-box; color: inherit; }
.page-sparks .spk-balance .vip-badge.is-crown b { font: inherit; }

/* ---------- админка ---------- */

.adm-vip-dash { margin: 24px 0; }
.adm-vip-more { margin-left: 10px; font-size: 13px; font-weight: 600; }
.adm-vip-levels { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.adm-vip-levels li, .adm-vip-levels a { display: grid; justify-items: start; gap: 4px; }
.adm-vip-levels li { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); opacity: 0.6; }
.adm-vip-levels li.is-on { opacity: 1; border-color: rgba(217, 183, 122, 0.4); }
.adm-vip-levels a { color: inherit; text-decoration: none; }
.adm-vip-levels b.num { font-size: 22px; line-height: 1; }
.adm-vip-levels small { color: var(--muted); font-size: 11.5px; }
.adm-vip .adm-inline-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.adm-vip .adm-inline-form input { min-width: 200px; flex: 1; }
.adm-vip-decided { margin: 10px 0 24px; }
.adm-vip-decided ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.adm-vip-table td { vertical-align: top; }
.adm-vip-table td, .adm-vip-table th { white-space: normal; }
.adm-vip-table td:first-child { white-space: nowrap; }
.adm-vip-table td:last-child { min-width: 220px; }

/* ---------- профиль, меню ---------- */

.pf-name .vip-badge { margin-left: 10px; height: 22px; padding: 0 9px 0 7px; font-size: 11px; transform: translateY(-4px); }
.pf-name .vip-badge svg { width: 14px; height: 14px; }
.menu-head .vip-badge { margin-left: 4px; }
.navlink-badge.is-vip { background: var(--grad-gold); color: #1b1206; }

@media (max-width: 900px) {
  .vip-hero-in { grid-template-columns: 1fr; }
  .vip-card { max-width: 460px; width: 100%; justify-self: center; }
}
@media (max-width: 560px) {
  .vip-shell { gap: 40px; }
  .vip-step { grid-template-columns: 44px minmax(0, 1fr); gap: 0 10px; }
  .vip-step-rail { padding-top: 16px; }
  .vip-step .vip-medal.is-sm { --m: 36px; }
  .vip-step-card { padding: 14px 14px 16px; }
  .vip-step-head h3 { font-size: 22px; }
  .vip-step-items { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
  .vip-card { padding: 28px 18px 20px; }
  .vip-medal { --m: 80px; }
  .vip-title-form { flex-direction: column; }
  .vip-up .vip-up-box { padding: 36px 18px 20px; }
  .vip-up .vip-perk-list li { font-size: 13.5px; }
  .vip-up .dialog-text { font-size: 14px; }
}
/* the owner hid the mark (users.vip_hidden): only they see it, dimmed */
.vip-badge.is-hidden { opacity: 0.5; filter: grayscale(0.7); box-shadow: 0 0 0 1px var(--line-2) inset; }
