/* Dark Carnival — v3: иконки, меню, волна, окна, выпадающие списки, пополнение, документы (поверх motion.css) */
.icon-btn.off::after { display: none; }
.brand-ic { width: 18px; height: 18px; flex: 0 0 auto; fill: currentColor; }
.btn .brand-ic { width: 20px; height: 20px; }

/* подложка активного пункта меню */
.nav { position: relative; }
.nav-ind { position: absolute; left: 0; top: 0; z-index: 0; border-radius: 8px; background: var(--surface-2); pointer-events: none;
  transition: transform .35s var(--spring), width .35s var(--spring), opacity .2s; }
.nav a { position: relative; z-index: 1; }
.nav a.active { background: transparent; }
.nav a .ic { transition: transform .25s var(--spring), color .2s, opacity .2s; }
.nav a:hover .ic { transform: translateY(-1px) scale(1.08); }
.nav a.active .ic { animation: NavPop .4s var(--spring); }
@keyframes NavPop { 40% { transform: scale(1.25) rotate(-6deg); } }

/* волна при нажатии */
.btn, .chip, .dep-method, .case-tile { position: relative; overflow: hidden; isolation: isolate; }
.ripple { position: absolute; z-index: -1; border-radius: 50%; background: currentColor; opacity: .18; transform: scale(0); pointer-events: none; animation: Ripple .6s ease-out forwards; }
@keyframes Ripple { to { transform: scale(1); opacity: 0; } }

/* блики и мелкие движения */
.case-tile::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent);
  transform: translateX(-130%) skewX(-18deg); pointer-events: none; }
.case-tile:hover::after { animation: Shine .9s var(--ease); }
.brand img { transition: transform .6s var(--spring); }
.brand:hover img { transform: rotate(-20deg) scale(1.06); }
.balance.bal-up img { animation: CoinSpin .6s var(--ease); }
@keyframes CoinSpin { to { transform: rotateY(360deg); } }
.loot-grid .item-card.r-arcana, .loot-grid .item-card.r-immortal, .inv-grid .item-card.r-arcana, .inv-grid .item-card.r-immortal { animation: Rise .35s var(--ease) both, RarePulse 2.4s 1s ease-in-out infinite; }
@keyframes RarePulse { 50% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--rc) 70%, transparent), 0 0 22px color-mix(in srgb, var(--rc) 35%, transparent); } }

/* ---------- модальные окна ---------- */
.modal-card { position: relative; padding: 28px; }
.modal-x { position: absolute; top: 14px; right: 14px; z-index: 2; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0;
  background: var(--surface-2); color: var(--text-2); cursor: pointer; transition: background-color .15s, color .15s, transform .2s var(--spring); }
.modal-x:hover { background: var(--surface-3); color: var(--text); transform: rotate(90deg); }
.modal-x .ic { width: 18px; height: 18px; }
.modal-card > h2 { padding-right: 40px; }

/* ---------- пополнение ---------- */
.modal-card.dep-modal { width: min(540px, 100%); padding: 26px 26px 20px; }
.dep-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; padding-right: 40px; }
.dep-head-ico { flex: 0 0 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; background: var(--gold-soft); color: var(--gold); }
.dep-head-ico .ic { width: 24px; height: 24px; }
.dep-head h2 { margin: 0 !important; font-size: 21px !important; }
.dep-head p { margin: 4px 0 0 !important; font-size: 13.5px; color: var(--text-3) !important; }
.dep-step { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; font: 600 14px/1 var(--body); color: var(--text); }
.dep-step i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font: 600 12px/1 var(--body); font-style: normal; }
.dep-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dep-method { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 12px; text-align: left; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); transition: border-color .2s, background-color .2s, transform .2s var(--ease); box-shadow: none; }
.dep-method:hover { border-color: var(--text-3); transform: translateY(-2px); }
.dep-method.on { background: color-mix(in srgb, var(--gold) 7%, var(--surface-2)); border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.dep-art { display: flex; align-items: center; height: 30px; }
.dep-logo.sbp { width: 25px; height: 30px; }
.dep-cards { display: flex; align-items: center; gap: 8px; }
.dep-logo.visa { width: 40px; height: 26px; color: #fff; fill: #fff; }
.dep-logo.mc { width: 36px; height: 24px; }
.dep-mtext { display: flex; flex-direction: column; gap: 3px; }
.dep-mtext b { font: 600 15px/1.2 var(--body); }
.dep-mtext small { font-size: 12.5px; line-height: 1.3; color: var(--text-3); }
.dep-badge { position: absolute; top: 12px; right: 40px; padding: 4px 7px; border-radius: 6px; background: rgba(60, 207, 122, .12); color: var(--ok); font: 600 11px/1 var(--body); font-style: normal; }
.dep-radio { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); transition: background-color .2s, border-color .2s; }
.dep-radio .ic { width: 13px; height: 13px; stroke-width: 3; color: var(--gold-ink); transform: scale(0); transition: transform .25s var(--spring); }
.dep-method.on .dep-radio { background: var(--gold); border-color: var(--gold); }
.dep-method.on .dep-radio .ic { transform: scale(1); }
.dep-amount { position: relative; display: block; margin: 0; }
.dep-amount input { width: 100%; height: 56px; padding: 0 44px 0 18px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line-2); color: var(--text); font: 600 24px/1 var(--body);
  -moz-appearance: textfield; transition: border-color .15s, box-shadow .15s; }
.dep-amount input::-webkit-outer-spin-button, .dep-amount input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dep-amount input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.dep-amount.bad input { border-color: var(--bad); }
.dep-amount > span { position: absolute; right: 18px; top: 50%; translate: 0 -50%; color: var(--text-3); font: 500 20px/1 var(--body); }
.dep-presets { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.dep-presets .chip { padding: 9px 4px; font-size: 13.5px; text-align: center; }
.dep-limits { margin-top: 8px; font-size: 12.5px; color: var(--text-3); transition: color .15s; }
.dep-limits.bad { color: var(--bad); }
.dep-sum { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 14px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-2); }
.dep-sum > span { color: var(--text-2); font-size: 14px; }
.dep-sum b { display: flex; align-items: center; gap: 8px; font: 600 22px/1 var(--body); font-variant-numeric: tabular-nums; }
.dep-sum .coin-i { width: 22px; height: 22px; }
.dep-check { position: relative; display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; font-size: 13px; line-height: 1.45; color: var(--text-2); cursor: pointer; }
.dep-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dep-box { flex: 0 0 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; border: 1.5px solid var(--line-2); background: var(--bg); transition: background-color .15s, border-color .15s; }
.dep-box .ic { width: 14px; height: 14px; stroke-width: 3; color: var(--gold-ink); transform: scale(0); transition: transform .25s var(--spring); }
.dep-check input:checked + .dep-box { background: var(--gold); border-color: var(--gold); }
.dep-check input:checked + .dep-box .ic { transform: scale(1); }
.dep-check input:focus-visible + .dep-box { outline: 2px solid var(--gold); outline-offset: 2px; }
.dep-check a { color: var(--text); text-underline-offset: 3px; }
.dep-check a:hover { color: var(--gold); }
.dep-go { width: 100%; }
.dep-go.loading span::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 10px; vertical-align: -2px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: DepSpin .7s linear infinite; }
.dep-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px 0 0 !important; font-size: 12.5px; color: var(--text-3) !important; text-align: center; }
.dep-note .ic { width: 14px; height: 14px; color: var(--ok); }
.dep-hist { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.dep-hist summary { display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; font-size: 13.5px; color: var(--text-2); }
.dep-hist summary::-webkit-details-marker { display: none; }
.dep-hist summary .ic { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.dep-hist[open] summary .ic { transform: rotate(180deg); }
.dep-hist .dep-history { margin-top: 10px; animation: Rise .3s var(--ease); }
.dep-row { padding: 9px 12px; border-radius: 9px; font-size: 13.5px; }
.dep-row span { color: var(--text-3); }
.dep-row b { color: var(--text); }
.dep-row.s-pending em { color: var(--gold); }
.dep-all { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.dep-all:hover { color: var(--text); }

/* ---------- выпадающие списки ---------- */
.csel { position: relative; min-width: 0; }
.csel-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 42px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line-2); color: var(--text-2); font: 400 14px/1 var(--body); text-align: left; transition: border-color .15s, color .15s; }
.csel-btn span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.csel-btn .ic { flex: 0 0 16px; width: 16px; height: 16px; color: var(--text-3); transition: transform .25s var(--ease); }
.csel-btn:hover, .csel.open .csel-btn { border-color: var(--text-3); color: var(--text); }
.csel.set .csel-btn { color: var(--text); }
.csel.open .csel-btn .ic { transform: rotate(180deg); }
.csel-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: max(100%, 220px); padding: 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6); animation: SelIn .18s var(--ease); transform-origin: 50% 0; }
.csel-pop[hidden] { display: none; }
@keyframes SelIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.csel-search { position: relative; display: block; margin-bottom: 6px; }
.csel-search .ic { position: absolute; left: 10px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--text-3); }
.csel-search input { width: 100%; height: 36px; padding: 0 10px 0 32px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line-2); color: var(--text); font: 400 14px/1 var(--body); }
.csel-search input:focus { outline: none; border-color: var(--text-3); }
.csel-list { max-height: 300px; overflow-y: auto; margin: 0; padding: 0; list-style: none; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.csel-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border-radius: 7px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.csel-list li .ic { width: 15px; height: 15px; color: var(--gold); opacity: 0; }
.csel-list li.hl { background: var(--surface-3); color: var(--text); }
.csel-list li.on { color: var(--text); font-weight: 500; }
.csel-list li.on .ic { opacity: 1; }

/* ---------- документы ---------- */
.legal { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.legal-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.legal-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; color: var(--text-2); text-decoration: none; font-size: 14px; transition: background-color .15s, color .15s; }
.legal-nav a:hover { background: var(--surface-2); color: var(--text); }
.legal-nav a.on { background: var(--surface-2); color: var(--text); }
.legal-nav a .ic { width: 18px; height: 18px; color: var(--text-3); }
.legal-nav a.on .ic { color: var(--gold); }
.legal-doc { padding: 32px 36px; animation: Rise .4s var(--ease) both; }
.legal-doc h1 { margin: 0; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; }
.legal-ed { margin: 8px 0 24px; font-size: 13px; color: var(--text-3); }
.legal-doc h2 { margin: 28px 0 10px; font-size: 17px; }
.legal-doc p, .legal-doc li { color: var(--text-2); font-size: 15px; line-height: 1.65; }
.legal-doc p { margin: 0 0 12px; max-width: 78ch; }
.legal-doc ul { margin: 0 0 12px; padding-left: 20px; max-width: 78ch; }
.legal-doc li { margin-bottom: 6px; }
.legal-doc li::marker { color: var(--gold); }
.legal-doc b { color: var(--text); font-weight: 600; }
.legal-doc a { color: var(--text); text-underline-offset: 3px; }
.legal-doc a:hover { color: var(--gold); }
.req { display: grid; grid-template-columns: 200px minmax(0, 1fr); margin: 0 0 20px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.req dt, .req dd { margin: 0; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.req dt { color: var(--text-3); background: var(--surface-2); }
.req dd { color: var(--text); }
.req dt:last-of-type, .req dd:last-of-type { border-bottom: 0; }
.footer-bottom span:nth-child(2) { color: var(--text-3); }

@media (max-width: 860px) {
  .legal { grid-template-columns: 1fr; }
  .legal-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .legal-nav a { flex: 0 0 auto; }
  .legal-nav a span { white-space: nowrap; }
  .legal-doc { padding: 22px 18px; }
  .req { grid-template-columns: 1fr; }
  .req dt { border-bottom: 0; padding-bottom: 4px; background: none; font-size: 13px; }
  .req dd { padding-top: 0; }
}
@media (max-width: 520px) {
  .modal { padding: 10px; align-items: end; }
  .modal-card { padding: 22px 18px 18px; max-height: 92vh; }
  .modal-card.dep-modal { padding: 20px 16px 16px; }
  .dep-methods { gap: 8px; }
  .dep-method { padding: 12px; }
  .dep-badge { display: none; }
  .dep-presets { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dep-head { margin-bottom: 14px; }
  .dep-head-ico { display: none; }
  .csel-btn { padding: 0 8px 0 10px; gap: 4px; font-size: 13px; }
  .csel-btn .ic { flex-basis: 14px; width: 14px; height: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
