/* ==========================================================================
   SKIN BATTLE: стили.
   Порядок: токены, база, кнопки, вход, главное меню, ожидание, окна, затем матч и результаты.
   Шкала отступов 4 / 8 / 12 / 16 / 24 / 32, радиусы 8 / 12 / 16, подписи 11 px капсом.
   ========================================================================== */

:root {
  --bg: #0c0f14;
  --bg2: #11151c;
  --panel: #161b24;
  --panel2: #1c232e;
  --line: #2a3442;
  --line-soft: #202835;
  --text: #e8eef6;
  --muted: #8794a6;
  --accent: #5ab0ff;
  --accent2: #2b7fd0;
  --gold: #e4ae39;
  --good: #5fd48a;
  --bad: #ff6b5e;
  --rarity: #4b69ff;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font-family: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1200px 700px at 50% -10%, #1a2433 0%, var(--bg) 60%) fixed;
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.screen { min-height: 100vh; min-height: 100dvh; }

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

/* ---------- кнопки ---------- */
.btn {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 20px;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.08s, background 0.15s, border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.btn:hover:not(:disabled) { background: #232c3a; border-color: #3b4a5f; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn small { display: block; font-size: 11px; font-weight: 500; letter-spacing: 0.04em; opacity: 0.7; margin-top: 2px; }
.btn-primary {
  background: linear-gradient(180deg, #4aa3ff, var(--accent2));
  border-color: #7cc2ff;
  color: #04111f;
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #67b4ff, #3a8ee0); box-shadow: 0 0 24px rgba(90, 176, 255, 0.4); }
.btn-xl { font-size: 16px; padding: 16px 24px; width: 100%; }
.btn-danger { background: #2a1a1c; border-color: #6d3438; color: #ffb4ab; }
.btn-danger:hover:not(:disabled) { background: #3a2023; border-color: #8f444a; }
.btn-ghost { background: none; border: 1px solid transparent; border-radius: var(--radius); color: var(--muted); padding: 6px 10px; font-size: 12px; cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.btn-ghost:hover { color: var(--text); border-color: var(--line); }

/* ---------- поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }
.field input, .bid-input input {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .bid-input input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(90, 176, 255, 0.18); }
.form-error { min-height: 18px; color: var(--bad); font-size: 13px; }

/* ---------- бренд ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--accent); font-size: 20px; text-shadow: 0 0 18px rgba(90, 176, 255, 0.7); }
.brand-name { font-weight: 700; letter-spacing: 0.12em; font-size: 13px; }
.brand-name b { color: var(--accent); font-weight: 800; }
.brand-xl { gap: 16px; }
.brand-xl .brand-mark { font-size: 46px; animation: spin-slow 8s linear infinite; }
.brand-xl h1 { font-size: 40px; line-height: 0.95; letter-spacing: 0.06em; font-weight: 800; }
.brand-xl h1 span { color: var(--accent); }

/* ---------- вход ---------- */
.login { max-width: 440px; margin: 0 auto; padding: 12vh 24px 40px; display: flex; flex-direction: column; gap: 20px; animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.lead { color: var(--muted); line-height: 1.55; }
.fineprint { color: var(--muted); font-size: 12px; text-align: center; }
/* Вход невозможен: остаётся логотип и причина. */
.login.blocked .field, .login.blocked #btn-login, .login.blocked .fineprint { display: none; }
.login.blocked .form-error { font-size: 15px; text-align: center; }

/* ---------- главное меню: шапка и вкладки ---------- */
.appbar {
  position: sticky; top: 0; z-index: 8;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; border-bottom: 1px solid var(--line-soft);
  background: rgba(12, 15, 20, 0.78); backdrop-filter: blur(10px);
}
.who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.who-text { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; min-width: 0; }
.who-text b { font-size: 14px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text span { font-size: 12px; font-weight: 700; color: var(--good); font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 4px; width: max-content; margin: 20px auto 0; padding: 4px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; }
.tab { position: relative; display: flex; align-items: center; gap: 8px; padding: 9px 20px; background: none; border: 0; border-radius: 9px; color: var(--muted); font-weight: 700; font-size: 13px; letter-spacing: 0.06em; cursor: pointer; transition: color 0.15s, background 0.15s; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--panel2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.tab-ico { font-style: normal; color: var(--accent); font-size: 12px; }
.tab-badge { font-style: normal; font-size: 11px; font-weight: 800; min-width: 20px; padding: 1px 6px; text-align: center; border-radius: 999px; background: var(--accent); color: #04111f; }

.home { max-width: 980px; margin: 0 auto; padding: 20px 24px 48px; }
.pane { animation: rise 0.35s both; }

/* ---------- карточки и «Играть» ---------- */
.card { background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent), var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.play-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.balance-card { padding: 24px; }
.balance { margin: 6px 0 12px; font-size: 56px; line-height: 1; font-weight: 800; color: var(--good); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 13px; }
.stats b { color: var(--text); margin-left: 4px; }

.bonus-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-color: #6f5a24; background: linear-gradient(135deg, rgba(228, 174, 57, 0.14), transparent 70%), var(--panel); animation: rise 0.4s both; }
.bonus-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bonus-text b { color: var(--gold); }
.bonus-text span { color: var(--muted); font-size: 13px; }

.stakes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.stake { padding: 14px 6px; text-align: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.1s; }
.stake b { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stake small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.stake:hover:not(:disabled) { border-color: #3b4a5f; transform: translateY(-1px); }
.stake.active { border-color: var(--accent); background: rgba(90, 176, 255, 0.1); box-shadow: 0 0 0 1px var(--accent) inset, 0 0 24px rgba(90, 176, 255, 0.18); }
.stake:disabled { opacity: 0.4; cursor: not-allowed; }
.stake-note { margin-top: 12px; min-height: 36px; font-size: 12px; line-height: 1.5; color: var(--muted); }

.modes { display: grid; gap: 12px; }
.mode { text-align: left; padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: transform 0.1s, border-color 0.15s, box-shadow 0.15s, background 0.15s; }
.mode b { font-size: 16px; letter-spacing: 0.08em; }
.mode span { font-size: 13px; color: var(--muted); }
.mode:hover:not(:disabled) { transform: translateY(-2px); border-color: #3b4a5f; background: var(--panel2); }
.mode:disabled { opacity: 0.35; cursor: not-allowed; }
.mode-primary { background: linear-gradient(180deg, #4aa3ff, var(--accent2)); border-color: #7cc2ff; color: #04111f; }
.mode-primary span { color: rgba(4, 17, 31, 0.72); }
.mode-primary:hover:not(:disabled) { background: linear-gradient(180deg, #67b4ff, #3a8ee0); border-color: #a3d3ff; box-shadow: 0 0 28px rgba(90, 176, 255, 0.4); }

.recent-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-size: 12px; font-weight: 700; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.recent-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.recent-item {
  --rarity: #4b69ff;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 6px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--rarity) 55%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--rarity) 18%, var(--bg2)), var(--bg2));
}
.recent-item img { width: 100%; height: 44px; object-fit: contain; }
.recent-item .fallback { height: 44px; display: flex; align-items: center; font-size: 10px; color: var(--muted); }
.recent-item b { font-size: 12px; color: var(--good); font-variant-numeric: tabular-nums; }
.recent-empty { grid-column: 1 / -1; font-size: 13px; line-height: 1.5; color: var(--muted); }

/* ---------- инвентарь ---------- */
.inv-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.inv-head h2 { font-size: 24px; }
.inv-head p { font-size: 13px; margin-top: 2px; min-height: 18px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; }
.seg-btn { padding: 7px 14px; background: none; border: 0; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.seg-btn.active { background: var(--panel2); color: var(--text); }

.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.inv-card {
  --rarity: #4b69ff;
  display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--rarity) 55%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--rarity) 16%, var(--panel)), var(--panel) 70%);
  transition: transform 0.15s, box-shadow 0.15s; animation: rise 0.35s both;
}
.inv-card:hover { transform: translateY(-3px); box-shadow: 0 8px 26px color-mix(in srgb, var(--rarity) 28%, transparent); }
.inv-img { height: 96px; display: flex; align-items: center; justify-content: center; }
.inv-img img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.55)); }
.inv-img .fallback { color: var(--muted); font-size: 12px; }
.inv-tags { display: flex; flex-wrap: wrap; gap: 4px; min-height: 18px; }
.inv-name { font-size: 14px; font-weight: 800; line-height: 1.2; }
.inv-name small { display: block; font-size: 10px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.inv-wear { font-size: 11px; color: var(--muted); }
.inv-foot { display: flex; flex-direction: column; gap: 1px; margin-top: auto; padding-top: 6px; border-top: 1px solid var(--line-soft); }
.inv-foot b { color: var(--good); font-size: 16px; font-variant-numeric: tabular-nums; }
.inv-foot span { font-size: 11px; color: var(--muted); }

.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 64px 16px; text-align: center; color: var(--muted); }
.empty b { color: var(--text); font-size: 16px; }
.empty p { max-width: 360px; line-height: 1.5; font-size: 13px; }
.empty-ico { font-size: 40px; color: var(--line); }

/* ---------- ожидание: поиск матча и код друга ---------- */
.wait { min-height: 100vh; min-height: 100dvh; max-width: 480px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; animation: rise 0.5s both; }
.wait h2 { letter-spacing: 0.2em; }
.pill { display: inline-flex; padding: 6px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--accent); font-weight: 800; font-size: 13px; letter-spacing: 0.06em; }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.radar { position: relative; width: 120px; height: 120px; margin-bottom: 8px; }
.radar i { position: absolute; inset: 0; border: 2px solid var(--accent); border-radius: 50%; opacity: 0; animation: ping 2.4s ease-out infinite; }
.radar i:nth-child(2) { animation-delay: 0.8s; }
.radar i:nth-child(3) { animation-delay: 1.6s; }
.radar::after { content: ''; position: absolute; inset: 46px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 24px var(--accent); }
.code { display: flex; gap: 10px; justify-content: center; }
.code span { width: 56px; height: 72px; display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 800; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); animation: card-in 0.6s both; }
.code span:nth-child(2) { animation-delay: 0.06s; }
.code span:nth-child(3) { animation-delay: 0.12s; }
.code span:nth-child(4) { animation-delay: 0.18s; }
.code span:nth-child(5) { animation-delay: 0.24s; }
.dots { display: flex; gap: 6px; margin-top: 4px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: dot 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }

/* ---------- окно «Битва с другом» ---------- */
.sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 8, 12, 0.72); backdrop-filter: blur(5px); animation: fade 0.2s both; }
.sheet-box { position: relative; width: min(440px, 100%); padding: 28px 24px 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); animation: rise 0.3s both; display: flex; flex-direction: column; gap: 16px; }
.sheet-box h3 { letter-spacing: 0.14em; font-size: 15px; }
.sheet-box p { font-size: 14px; line-height: 1.5; }
.sheet-box p b { color: var(--text); }
.sheet-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.sheet-close:hover { color: var(--text); background: var(--panel2); }
.sheet-actions { display: grid; gap: 10px; }
.sheet-box form { display: flex; flex-direction: column; gap: 14px; }
.code-input { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 30px; font-weight: 800; letter-spacing: 0.4em; text-align: center; text-transform: uppercase; padding-left: 0.4em; }
.code-status { min-height: 20px; font-size: 13px; text-align: center; color: var(--muted); }
.code-status.ok { color: var(--good); }
.code-status.err { color: var(--bad); }

.conn-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 50; text-align: center; padding: 8px; background: #6d3438; color: #ffd7d2; font-weight: 700; letter-spacing: 0.06em; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 32px); text-align: center; background: var(--panel2); border: 1px solid var(--line); padding: 10px 18px; border-radius: var(--radius); z-index: 60; box-shadow: var(--shadow); animation: rise 0.3s both; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dot { 0%, 100% { opacity: 0.25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

/* ---------- меню на телефоне ---------- */
@media (max-width: 820px) {
  .play-grid { grid-template-columns: 1fr; }
  .balance { font-size: 44px; }
}
@media (max-width: 700px) {
  .appbar { padding: 10px 16px; }
  .brand-name { display: none; }
  .who { margin-left: auto; }
  .who-text b { max-width: 120px; }
  .login { padding: 9vh 20px 24px; }
  .brand-xl h1 { font-size: 32px; }
  .btn-xl { padding: 16px 20px; }

  /* вкладки прижаты к низу, под большим пальцем */
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; width: auto; margin: 0; padding: 6px 12px calc(8px + env(safe-area-inset-bottom));
    gap: 8px; border: 0; border-top: 1px solid var(--line); border-radius: 0;
    background: rgba(12, 15, 20, 0.92); backdrop-filter: blur(12px);
  }
  .tab { flex: 1; flex-direction: column; gap: 2px; padding: 8px 6px; font-size: 11px; border-radius: 10px; }
  .tab.active { box-shadow: none; background: var(--panel2); }
  .tab-ico { font-size: 16px; }
  .tab-badge { position: absolute; top: 4px; right: calc(50% - 30px); }
  .home { padding: 14px 14px calc(88px + env(safe-area-inset-bottom)); }
  .card { padding: 16px; }
  .balance-card { padding: 18px; }
  .balance { font-size: 40px; margin-bottom: 8px; }
  .stakes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stake b { font-size: 20px; }
  .mode { padding: 16px; }
  .bonus-card { flex-direction: column; align-items: stretch; }
  /* на телефоне кнопки режимов должны быть видны сразу, поэтому призы уходят вниз */
  .play-grid { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  .col { display: contents; }
  .balance-card { order: 1; }
  .bonus-card { order: 2; }
  #stake-card { order: 3; }
  .modes { order: 4; }
  .recent-card { order: 5; }
  .inv-head { align-items: center; }
  .inv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .inv-img { height: 84px; }
  .code span { width: 48px; height: 62px; font-size: 34px; }
  .sheet { align-items: flex-end; padding: 0; }
  .sheet-box { width: 100%; border-radius: 18px 18px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); animation: sheet-up 0.3s both; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- верхняя панель матча ---------- */
.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 7px 20px; border-bottom: 1px solid var(--line); background: rgba(12, 15, 20, 0.7); backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 5;
}
.lot-counter { font-weight: 800; letter-spacing: 0.14em; font-size: 15px; }
.lot-counter .of { color: var(--muted); font-weight: 600; }
.turn-banner { font-weight: 800; letter-spacing: 0.16em; font-size: 12px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); transition: all 0.25s; }
.turn-banner.you { color: #04111f; background: var(--accent); border-color: #9bd0ff; box-shadow: 0 0 22px rgba(90, 176, 255, 0.55); animation: glow 1.4s ease-in-out infinite; }
.turn-banner.foe { color: var(--muted); }
.timer { position: relative; height: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; justify-self: end; width: min(320px, 100%); }
.timer-bar { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); transition: background 0.3s; }
.timer-bar.warn { background: linear-gradient(90deg, #c27a14, var(--gold)); }
.timer-bar.danger { background: linear-gradient(90deg, #b3261e, var(--bad)); animation: blink 0.6s steps(2) infinite; }
.timer span { position: relative; display: block; text-align: center; line-height: 20px; font-weight: 800; font-size: 12px; letter-spacing: 0.1em; text-shadow: 0 1px 2px #000; }

/* ---------- поле ---------- */
.board { display: grid; grid-template-columns: 230px minmax(380px, 1fr) 230px; gap: 12px; padding: 10px 16px 12px; max-width: 1400px; margin: 0 auto; }
.side { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; align-self: start; transition: border-color 0.25s, box-shadow 0.25s; }
.side.active { border-color: var(--accent); box-shadow: 0 0 30px rgba(90, 176, 255, 0.15); }
.side-head { display: flex; flex-direction: column; align-items: flex-start; gap: 0; margin-bottom: 2px; min-width: 0; }
.side-name { font-weight: 800; letter-spacing: 0.06em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-tag { font-size: 10px; letter-spacing: 0.16em; color: var(--muted); }
.side-money { font-size: 24px; font-weight: 800; color: var(--good); font-variant-numeric: tabular-nums; margin: 0 0 8px; }
.side-money.flash-down { animation: flash-down 0.7s; }
.slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.slot {
  aspect-ratio: 1; border: 1px dashed var(--line); border-radius: 6px; background: var(--bg2); position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: #3a4658; font-size: 11px;
}
.slot.filled { border: 1px solid var(--rarity); background: linear-gradient(180deg, color-mix(in srgb, var(--rarity) 26%, transparent), var(--bg2)); }
.slot.hide-img img { visibility: hidden; }
.slot img { width: 100%; height: 100%; object-fit: contain; }
.slot .paid { position: absolute; bottom: 1px; right: 3px; font-size: 10px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.slot-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 3px; font-size: 11px; color: var(--muted); }
.slot-list li { display: flex; justify-content: space-between; gap: 8px; border-left: 3px solid var(--rarity); padding: 2px 6px; background: var(--bg2); border-radius: 0 4px 4px 0; animation: rise 0.4s both; }
.slot-list b { color: var(--text); white-space: nowrap; }

/* ---------- центр ---------- */
.center { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.stage { min-height: 168px; display: flex; align-items: center; justify-content: center; perspective: 1200px; position: relative; }
.lot-card {
  --rarity: #4b69ff;
  width: min(100%, 560px); border-radius: 12px; padding: 10px 14px; position: relative; overflow: hidden;
  display: grid; grid-template-columns: 150px 1fr; grid-template-rows: auto auto 1fr; column-gap: 14px; align-items: start;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rarity) 22%, #141a23) 0%, #121720 55%);
  border: 1px solid color-mix(in srgb, var(--rarity) 70%, #000);
  box-shadow: 0 0 50px color-mix(in srgb, var(--rarity) 35%, transparent), inset 0 0 40px color-mix(in srgb, var(--rarity) 10%, transparent);
}
.lot-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.14) 50%, transparent 65%); transform: translateX(-120%); }
.lot-card.enter { animation: card-in 0.9s cubic-bezier(0.2, 0.9, 0.2, 1) both; }
.lot-card.enter::before { animation: sweep 1.2s 0.5s ease-out; }
.lot-card.burn { animation: burn 0.9s ease-in forwards; }
.lot-card.sold-fly { animation: none; }
.lot-img { grid-row: 1 / 4; align-self: center; height: 140px; display: flex; align-items: center; justify-content: center; position: relative; }
.lot-img img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.6)); }
.lot-img .fallback { color: var(--muted); font-size: 13px; }
.lot-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 4px; }
.tag { font-size: 10px; font-weight: 800; letter-spacing: 0.06em; padding: 2px 6px; border-radius: 3px; background: color-mix(in srgb, var(--rarity) 30%, #0b0e13); border: 1px solid color-mix(in srgb, var(--rarity) 70%, #000); text-transform: uppercase; }
.tag.st { color: #ff9b3d; border-color: #b36a1d; background: #2a1a0a; }
.tag.sv { color: #ffd84a; border-color: #8d7a1a; background: #2a2508; }
.tag.star { color: var(--gold); border-color: #8d6a1a; background: #2a2008; }
.lot-name { font-size: 18px; font-weight: 800; line-height: 1.15; }
.lot-name small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 2px; }
.lot-hidden { margin-top: 8px; align-self: end; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hidden-box { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
.hidden-box span { display: block; font-size: 10px; letter-spacing: 0.16em; color: var(--muted); }
.hidden-box b { display: block; font-size: 15px; margin-top: 0; letter-spacing: 0.2em; background: linear-gradient(90deg, #2a3442 20%, #5a6a80 50%, #2a3442 80%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.8s linear infinite; }

.bid-panel { text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px 6px; }
.bid-label { font-size: 11px; letter-spacing: 0.2em; color: var(--muted); }
.bid-value { font-size: 34px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bid-value.pop { animation: pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
.bid-holder { min-height: 14px; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); }
.bid-holder.you { color: var(--accent); }
.bid-holder.foe { color: var(--bad); }

.controls { display: grid; gap: 6px; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.quick .btn { font-size: 14px; padding: 6px 6px; }
.quick .btn small { display: block; font-size: 9px; opacity: 0.7; letter-spacing: 0.1em; margin-top: 0; }
.bid-row { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; }
.bid-input { position: relative; }
.bid-input::before { content: '$'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.bid-input input { width: 100%; padding: 8px 10px 8px 28px; font-size: 16px; font-weight: 700; }
.solo { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.hint { min-height: 15px; text-align: center; font-size: 12px; color: var(--muted); }
.hint.err { color: var(--bad); }


/* ---------- затемнение при отключении ---------- */
.overlay { position: fixed; inset: 0; background: rgba(5, 8, 12, 0.82); display: flex; align-items: center; justify-content: center; z-index: 20; backdrop-filter: blur(4px); }
.overlay-box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px 36px; text-align: center; max-width: 420px; }
.overlay-box h3 { margin: 0 0 8px; letter-spacing: 0.14em; color: var(--gold); }
.overlay-box .big { font-size: 48px; font-weight: 800; font-variant-numeric: tabular-nums; }


/* ---------- финал ---------- */
.final { max-width: 1100px; margin: 0 auto; padding: 12px 20px 16px; }
.final-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin-bottom: 10px; }
.final-vs { font-weight: 800; color: var(--muted); letter-spacing: 0.2em; }
.final-score { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 16px; transition: all 0.4s; }
.final-score h4 { margin: 0; letter-spacing: 0.1em; }
.final-score .sum { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.final-score .sub { color: var(--muted); font-size: 13px; }
.final-score.winner { border-color: var(--good); box-shadow: 0 0 40px rgba(95, 212, 138, 0.3); }
.final-score.loser { opacity: 0.7; }
.final-score:last-child { text-align: right; }

.reveal-grid { display: flex; flex-direction: column; gap: 6px; }
.rrow { display: grid; grid-template-columns: 74px 1fr; gap: 8px; align-items: stretch; }
.rlabel { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-left: 3px solid var(--line); padding-left: 8px; display: flex; flex-direction: column; justify-content: center; gap: 2px; line-height: 1.2; }
.rlabel b { font-size: 18px; color: var(--text); letter-spacing: 0; }
.rrow.you .rlabel { border-color: var(--accent); color: var(--accent); }
.rrow.foe .rlabel { border-color: var(--bad); color: var(--bad); }
.rtiles { display: flex; gap: 6px; min-height: 112px; align-items: stretch; }
.rtiles .tile { flex: 1 1 0; min-width: 0; max-width: 210px; }
.rrow.empty .rtiles { min-height: 26px; }
.rempty { align-self: center; color: #3a4658; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.tile { --rarity: #4b69ff; perspective: 900px; height: 112px; }
.tile-inner { position: relative; width: 100%; height: 100%; transition: transform 0.7s cubic-bezier(0.3, 0.8, 0.2, 1); transform-style: preserve-3d; }
.tile.flipped .tile-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; border: 1px solid color-mix(in srgb, var(--rarity) 70%, #000); }
.face.back { background: repeating-linear-gradient(45deg, #151b24 0 10px, #121720 10px 20px); align-items: center; justify-content: center; font-size: 32px; font-weight: 800; color: var(--muted); }
.face.back::after { content: '?'; }
.face.front { transform: rotateY(180deg); background: linear-gradient(180deg, color-mix(in srgb, var(--rarity) 22%, #141a23), #10151d); box-shadow: 0 0 24px color-mix(in srgb, var(--rarity) 30%, transparent); }
.face img { width: 100%; height: 38px; object-fit: contain; flex: none; }
.face .t-name { font-size: 10px; font-weight: 800; line-height: 1.15; margin-top: 1px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-height: 2.35em; flex: none; }
.face .t-wear { font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.face .t-price { margin-top: auto; font-size: 13px; display: flex; justify-content: space-between; align-items: baseline; gap: 4px; font-weight: 800; font-variant-numeric: tabular-nums; }
.face .t-owner { font-size: 9px; font-weight: 800; letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-owner.you { color: var(--accent); }
.t-owner.foe { color: var(--bad); }
.t-owner.none { color: var(--muted); }
.t-delta.good { color: var(--good); }
.t-delta.bad { color: var(--bad); }
.tile.flipped .face.front { animation: tile-glow 1s ease-out; }

.final-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; min-height: 48px; }
.verdict { text-align: left; font-size: 24px; font-weight: 800; letter-spacing: 0.14em; margin: 0; animation: card-in 0.8s both; }
.verdict.win { color: var(--good); text-shadow: 0 0 40px rgba(95, 212, 138, 0.6); }
.verdict.lose { color: var(--bad); text-shadow: 0 0 40px rgba(255, 107, 94, 0.5); }
.verdict.draw { color: var(--gold); }
.verdict small { display: block; font-size: 12px; letter-spacing: 0.1em; color: var(--muted); margin-top: 6px; font-weight: 600; }
.final-actions { display: flex; justify-content: flex-end; gap: 10px; margin-left: auto; }
.final-actions .btn { padding: 9px 16px; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 30; }
.confetti i { position: absolute; top: -20px; width: 8px; height: 14px; opacity: 0; animation: fall linear forwards; }

/* ---------- анимации ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes ping { 0% { transform: scale(0.3); opacity: 0.9; } 100% { transform: scale(1.2); opacity: 0; } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 14px rgba(90, 176, 255, 0.35); } 50% { box-shadow: 0 0 30px rgba(90, 176, 255, 0.8); } }
@keyframes blink { 50% { opacity: 0.55; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.22); color: var(--accent); } 100% { transform: scale(1); } }
@keyframes flash-down { 0% { color: var(--bad); transform: scale(1.08); } 100% { color: var(--good); transform: none; } }
@keyframes sweep { to { transform: translateX(120%); } }
@keyframes card-in {
  0% { opacity: 0; transform: rotateY(-90deg) translateY(30px) scale(0.85); filter: brightness(2.2); }
  60% { opacity: 1; filter: brightness(1.4); }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes burn {
  0% { opacity: 1; filter: none; transform: none; }
  40% { filter: grayscale(1) brightness(1.6) contrast(1.4); }
  100% { opacity: 0; filter: grayscale(1) blur(6px); transform: scale(0.82) translateY(30px) rotate(-4deg); }
}
@keyframes tile-glow { 0% { filter: brightness(2.4); } 100% { filter: none; } }
@keyframes fall { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0.9; transform: translateY(110vh) rotate(720deg); } }

/* Две вкладки рядом на одном экране: боковые панели сужаются, раскладка остаётся в три колонки. */
@media (max-width: 1060px) {
  .board { grid-template-columns: 150px minmax(0, 1fr) 150px; gap: 8px; padding: 8px 8px 10px; }
  .side-money { font-size: 20px; }
  .slot-list { display: none; }
  .topbar { padding: 6px 10px; gap: 8px; }
  .lot-card { grid-template-columns: 120px 1fr; }
  .lot-img { height: 110px; }
  .final { padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media (max-height: 640px) {
  .lot-img { height: 110px; }
  .stage { min-height: 130px; }
  .lot-card { grid-template-columns: 120px 1fr; }
  .bid-value { font-size: 28px; }
  .tile, .rtiles { height: 100px; min-height: 100px; }
  .face img { height: 30px; }
}





/* ---------- телефон, вертикальный экран ---------- */
@media (max-width: 700px) {
  html { -webkit-text-size-adjust: 100%; }
  .btn, button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  .screen { min-height: 100vh; min-height: 100dvh; }


  /* матч: колонка «соперник → лот → ставка → вы → кнопки», кнопки приклеены к низу */
  #screen-match { display: flex; flex-direction: column; }
  .topbar { grid-template-columns: 1fr auto; grid-template-areas: 'lot turn' 'timer timer'; gap: 6px 10px; padding: 8px 12px; }
  .lot-counter { grid-area: lot; font-size: 15px; }
  .turn-banner { grid-area: turn; justify-self: end; }
  .timer { grid-area: timer; width: 100%; height: 16px; justify-self: stretch; }
  .timer span { line-height: 16px; font-size: 11px; }

  .board { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 8px 10px 0; max-width: none; }
  .center { display: contents; }
  #side-foe { order: 1; }
  .stage { order: 2; flex: 1 1 auto; min-height: 0; }
  .bid-panel { order: 3; }
  #side-you { order: 4; }
  .controls { order: 5; }
  .hint { order: 6; }

  .side { align-self: stretch; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'head slots' 'money slots'; align-items: center; gap: 0 10px; padding: 7px 10px; }
  .side-head { grid-area: head; flex-direction: row; align-items: baseline; gap: 8px; margin: 0; }
  .side-name { font-size: 14px; }
  .side-tag { font-size: 9px; }
  .side-money { grid-area: money; font-size: 22px; margin: 0; }
  .slots { grid-area: slots; width: 176px; gap: 3px; }
  .slot-list { display: none; }

  .lot-card { width: 100%; grid-template-columns: 1fr; grid-template-rows: auto; padding: 10px 12px; }
  .lot-img { grid-row: auto; height: clamp(90px, 17vh, 150px); }
  .lot-tags { justify-content: center; margin-top: 4px; }
  .lot-name { text-align: center; font-size: 18px; }
  .lot-hidden { margin-top: 6px; }

  .bid-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'label value' 'holder value'; align-items: center; text-align: left; padding: 6px 14px; }
  .bid-label { grid-area: label; }
  .bid-holder { grid-area: holder; min-height: 0; }
  .bid-value { grid-area: value; font-size: 38px; }

  .controls {
    position: sticky; bottom: 0; z-index: 6; gap: 8px;
    margin: 0 -10px; padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(12, 15, 20, 0.88), #0c0f14 22%);
    border-top: 1px solid var(--line);
  }
  .quick { gap: 8px; }
  .quick .btn { min-height: 48px; font-size: 16px; padding: 6px; }
  .bid-row { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
  .bid-input input { min-height: 48px; font-size: 18px; }
  .bid-row .btn, .solo .btn { min-height: 48px; padding: 0 16px; }
  .solo .btn-xl { min-height: 52px; font-size: 15px; padding: 0 10px; }
  /* подсказка на телефоне только для ошибок, иначе уходит за край экрана */
  .hint { padding: 0 10px 8px; min-height: 0; font-size: 12px; }
  .hint:not(.err) { display: none; }

  /* результаты: три строки с горизонтальной прокруткой карточек */
  .final { padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); }
  .final-head { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
  .final-vs { display: none; }
  .final-score { padding: 7px 10px; }
  .final-score h4 { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .final-score .sum { font-size: 24px; }
  .final-score .sub { font-size: 11px; }
  .rrow { grid-template-columns: 1fr; gap: 4px; }
  .rlabel { flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 8px; }
  .rlabel b { font-size: 14px; }
  .rtiles { overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 4px; min-height: 128px; height: auto; -webkit-overflow-scrolling: touch; }
  .rrow.empty .rtiles { min-height: 22px; }
  .rtiles .tile { flex: 0 0 108px; max-width: none; height: 128px; scroll-snap-align: start; }
  .face img { height: 44px; }
  .final-foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .verdict { text-align: center; font-size: 22px; }
  .final-actions { width: 100%; margin: 0; }
  .final-actions .btn { flex: 1; min-height: 48px; }
  .overlay-box { margin: 0 16px; padding: 20px; }
}



/* низкие телефоны (например 360×640): сжимаем лот, чтобы всё помещалось над кнопками */
@media (max-width: 700px) and (max-height: 720px) {
  .topbar { padding: 6px 12px; gap: 4px 10px; }
  .board { gap: 6px; padding-top: 6px; }
  .side { padding: 5px 10px; }
  .side-money { font-size: 19px; }
  .slots { width: 160px; }
  .lot-card { padding: 8px 10px; }
  .lot-img { height: clamp(64px, 14vh, 110px); }
  .lot-name { font-size: 16px; }
  .lot-hidden { margin-top: 4px; }
  .hidden-box { padding: 3px 8px; }
  .hidden-box b { font-size: 13px; }
  .bid-panel { padding: 4px 14px; }
  .bid-value { font-size: 30px; }
  .controls { gap: 6px; padding-top: 6px; }
  .quick .btn, .bid-row .btn, .bid-input input { min-height: 42px; }
}


/* ---------- матч: плашка ставки и итоги расчёта ---------- */
.stake-tag { margin-left: 10px; padding: 2px 8px; border: 1px solid #6f5a24; border-radius: 999px; background: rgba(228, 174, 57, 0.1); color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: 0.1em; vertical-align: middle; }

.final-foot { flex-wrap: wrap; }
.verdict { flex: 1 1 200px; }
.verdict-title { font-size: 24px; font-weight: 800; letter-spacing: 0.14em; }
.verdict-sub { margin-top: 2px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); text-shadow: none; }
.verdict.win .verdict-title { color: var(--good); text-shadow: 0 0 30px rgba(95, 212, 138, 0.55); }
.verdict.lose .verdict-title { color: var(--bad); text-shadow: 0 0 30px rgba(255, 107, 94, 0.45); }
.verdict.draw .verdict-title { color: var(--gold); }

.settle { display: flex; align-items: stretch; gap: 10px; animation: rise 0.5s both; }
.settle-delta, .prize { display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 6px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.settle-delta span, .prize span { font-size: 9px; font-weight: 800; letter-spacing: 0.12em; color: var(--muted); }
.settle-delta b { font-size: 20px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.settle-delta small, .prize small { font-size: 11px; color: var(--muted); }
.settle-delta.up b { color: var(--good); }
.settle-delta.up { border-color: rgba(95, 212, 138, 0.5); }
.settle-delta.down b { color: var(--bad); }
.settle-delta.down { border-color: rgba(255, 107, 94, 0.45); }
.settle-delta.flat b { font-size: 13px; color: var(--gold); }
.prize { flex-direction: row; align-items: center; gap: 10px; --rarity: #4b69ff; border-color: color-mix(in srgb, var(--rarity) 65%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--rarity) 20%, var(--panel)), var(--panel)); box-shadow: 0 0 22px color-mix(in srgb, var(--rarity) 25%, transparent); }
.prize img { width: 56px; height: 40px; object-fit: contain; flex: none; }
.prize > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.prize b { font-size: 13px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 700px) {
  .stake-tag { display: block; margin: 2px 0 0; width: max-content; }
  .lot-counter { line-height: 1.2; }
  .settle { width: 100%; }
  .settle > * { flex: 1; min-width: 0; }
  .verdict-title { font-size: 22px; }
}


/* ==========================================================================
   Аватары, плашки «Лучший дроп», профиль и витрина
   ========================================================================== */

.avatar {
  --s: 32px;
  --h: 210;
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: var(--s); height: var(--s); border-radius: 50%;
  font-size: calc(var(--s) * 0.46); font-weight: 800; line-height: 1; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  background: linear-gradient(135deg, hsl(var(--h) 62% 50%), hsl(calc(var(--h) + 40) 62% 30%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  object-fit: cover; user-select: none;
}
.avatar.ghost { background: var(--panel2); color: var(--muted); text-shadow: none; box-shadow: inset 0 0 0 1px var(--line); }

.who-btn { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; background: none; border: 1px solid transparent; border-radius: 999px; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.who-btn:hover { background: var(--panel); border-color: var(--line); }
.who-btn .who-text { align-items: flex-start; }

/* ---------- плашки ---------- */
.top-drops { margin-bottom: 16px; }
.top-title { margin-bottom: 8px; }
.top-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.plate {
  --rarity: #4b69ff;
  display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px 14px; border-radius: var(--radius-lg);
  border: 1px solid color-mix(in srgb, var(--rarity) 50%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--rarity) 15%, var(--panel)), var(--panel) 65%);
  transition: transform 0.15s, box-shadow 0.15s; animation: rise 0.35s both;
}
.plate:not(.empty):hover { transform: translateY(-2px); box-shadow: 0 8px 26px color-mix(in srgb, var(--rarity) 25%, transparent); }
.plate.empty { border-style: dashed; background: var(--panel); opacity: 0.75; }
.plate-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.plate-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.plate-body { display: flex; align-items: center; gap: 12px; min-width: 0; }
.plate-img { flex: none; width: 92px; height: 64px; display: flex; align-items: center; justify-content: center; }
.plate-img img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
.plate-img .fallback { font-size: 11px; color: var(--muted); }
.plate-img.q { font-size: 34px; font-weight: 800; color: var(--line); border-radius: 12px; background: var(--bg2); }
.plate-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.plate-user { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 0; background: none; border: 0; color: var(--text); font-size: 13px; cursor: pointer; text-align: left; }
.plate-user b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plate-user:hover b { color: var(--accent); text-decoration: underline; }
.plate-user.ghost { color: var(--muted); cursor: default; }
.plate-skin { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plate-meta { display: flex; align-items: baseline; gap: 8px; }
.plate-meta b { font-size: 17px; color: var(--good); font-variant-numeric: tabular-nums; }
.plate-meta span { font-size: 11px; color: var(--muted); }

/* ---------- инвентарь: витрина ---------- */
.inv-card { position: relative; }
.inv-card.showcased { border-color: #8d6a1a; box-shadow: 0 0 0 1px rgba(228, 174, 57, 0.25) inset; }
.inv-badge { position: absolute; top: 8px; right: 8px; padding: 2px 7px; border-radius: 999px; background: rgba(228, 174, 57, 0.15); border: 1px solid #8d6a1a; color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: 0.04em; }
.inv-act { margin-top: 8px; padding: 8px 6px; width: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); font-size: 12px; font-weight: 700; cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s; }
.inv-act:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.inv-act.on { color: var(--gold); border-color: #6f5a24; }
.inv-act.on:hover { border-color: var(--bad); color: var(--bad); }
.inv-act:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- профиль ---------- */
.profile { display: flex; flex-direction: column; gap: 16px; max-width: 760px; margin: 0 auto; }
.back { align-self: flex-start; font-size: 13px; }
.profile-head { display: flex; align-items: center; gap: 20px; }
.profile-id { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.profile-id h2 { font-size: 26px; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.profile-id p { font-size: 13px; }

.showcase-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.showcase-meta { font-size: 12px; color: var(--muted); }
.showcase-meta b { color: var(--good); font-variant-numeric: tabular-nums; }
.showcase { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.showcase-hint { margin-top: 12px; font-size: 12px; }
.vslot {
  --rarity: #4b69ff;
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 164px; padding: 12px 6px 10px; border-radius: 12px; text-align: center;
  border: 1px solid color-mix(in srgb, var(--rarity) 55%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--rarity) 18%, var(--bg2)), var(--bg2) 75%);
  animation: rise 0.35s both;
}
.vslot-img { width: 100%; height: 64px; display: flex; align-items: center; justify-content: center; }
.vslot-img img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
.vslot-name { font-size: 12px; font-weight: 800; line-height: 1.2; }
.vslot-name small { display: block; font-size: 9px; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.vslot-wear { font-size: 10px; color: var(--muted); }
.vslot-price { margin-top: auto; color: var(--good); font-size: 14px; font-variant-numeric: tabular-nums; }
.vslot.empty { justify-content: center; border: 1px dashed var(--line); background: var(--bg2); color: #3a4658; font-size: 26px; animation: none; }
.vslot.empty small { font-size: 10px; color: var(--muted); font-weight: 600; }
.vslot.add { cursor: pointer; transition: border-color 0.15s, color 0.15s; }
.vslot.add:hover { border-color: var(--accent); color: var(--accent); }
.vslot-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; }
.vslot-x:hover { color: var(--bad); border-color: var(--bad); }

.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 12px; background: var(--bg2); border: 1px solid var(--line-soft); border-radius: 12px; }
.stat > span { font-size: 11px; color: var(--muted); }
.stat b { font-size: 20px; font-variant-numeric: tabular-nums; }
.stat b small { margin-left: 6px; font-size: 12px; font-weight: 700; color: var(--accent); }
.stat.wide { grid-column: span 2; }
.stat.best { --rarity: #4b69ff; border-color: color-mix(in srgb, var(--rarity) 50%, var(--line-soft)); background: linear-gradient(135deg, color-mix(in srgb, var(--rarity) 14%, var(--bg2)), var(--bg2)); }
.best-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.best-row img { width: 76px; height: 50px; object-fit: contain; flex: none; }
.best-row > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.best-row b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.best-row small { font-size: 13px; font-weight: 800; color: var(--good); }

@media (max-width: 900px) {
  .plate-img { width: 72px; }
  .plate-meta span { display: none; }
}
@media (max-width: 700px) {
  .who-btn .who-text b { max-width: 96px; }
  /* три плашки в ряд: только подпись периода, скин, цена и ник */
  .top-row { gap: 8px; }
  .plate { padding: 8px 8px 10px; gap: 6px; }
  .plate-time, .plate-skin, .plate-meta span { display: none; }
  .plate-body { flex-direction: column; gap: 6px; text-align: center; }
  .plate-img { width: 100%; height: 48px; }
  .plate-info { align-items: center; width: 100%; }
  .plate-user { font-size: 12px; justify-content: center; }
  .plate-user .avatar { display: none; }
  .plate-meta b { font-size: 14px; }
  .top-title { margin-bottom: 6px; }
  .profile-head { gap: 14px; }
  .profile-head .avatar { --s: 64px; }
  .profile-id h2 { font-size: 22px; }
  .showcase { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat.wide { grid-column: span 2; }
}


/* ==========================================================================
   Счётчик онлайна, кнопки «?» и обучение
   ========================================================================== */

body.no-scroll { overflow: hidden; }

.appbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }

/* зелёное число с кружком слева */
.online {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 9px; border-radius: 999px;
  color: var(--good); font-size: 13px; line-height: 1; font-variant-numeric: tabular-nums;
  background: rgba(95, 212, 138, 0.1); border: 1px solid rgba(95, 212, 138, 0.28);
}
.online b { font-weight: 800; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(95, 212, 138, 0.6); animation: online-pulse 2s ease-out infinite; }
@keyframes online-pulse { 0% { box-shadow: 0 0 0 0 rgba(95, 212, 138, 0.55); } 70% { box-shadow: 0 0 0 7px rgba(95, 212, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(95, 212, 138, 0); } }

.icon-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 15px; font-weight: 800; cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--panel2); }

.guide-btn { display: flex; align-items: center; gap: 14px; padding: 12px 16px; text-align: left; background: transparent; border: 1px dashed var(--line); border-radius: var(--radius-lg); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.guide-btn:hover { border-color: var(--accent); background: rgba(90, 176, 255, 0.06); }
.guide-ico { flex: none; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(90, 176, 255, 0.14); border: 1px solid rgba(90, 176, 255, 0.4); color: var(--accent); font-weight: 800; }
.guide-text { display: flex; flex-direction: column; gap: 2px; }
.guide-text b { font-size: 14px; }
.guide-text small { font-size: 12px; color: var(--muted); }
.guide-btn.pulse { border-style: solid; border-color: var(--accent); animation: guide-pulse 2.4s ease-in-out infinite; }
@keyframes guide-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(90, 176, 255, 0); } 50% { box-shadow: 0 0 22px rgba(90, 176, 255, 0.35); } }

/* ---------- окно обучения ---------- */
.guide { position: fixed; inset: 0; z-index: 35; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 8, 12, 0.8); backdrop-filter: blur(5px); animation: fade 0.2s both; }
.guide-box { width: min(720px, 100%); max-height: min(90vh, 920px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; animation: rise 0.3s both; }
.guide-head { position: relative; flex: none; padding: 18px 56px 14px 22px; border-bottom: 1px solid var(--line-soft); }
.guide-head h3 { letter-spacing: 0.16em; font-size: 15px; }
.guide-body { flex: 1; overflow-y: auto; padding: 22px; overscroll-behavior: contain; }
.guide-foot { flex: none; padding: 12px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-soft); background: var(--panel); }

.step { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 14px; margin-bottom: 30px; }
.step:last-child { margin-bottom: 4px; }
.step-num { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: linear-gradient(180deg, #4aa3ff, var(--accent2)); color: #04111f; font-weight: 800; }
.step h4 { margin: 4px 0 6px; font-size: 17px; }
.step p { margin: 0 0 12px; color: var(--muted); line-height: 1.6; font-size: 14px; }
.step p b, .rules-list b { color: var(--text); }

.fig { margin: 12px 0; padding: 16px; background: var(--bg2); border: 1px solid var(--line-soft); border-radius: 14px; }
.fig-cap { display: block; margin: 10px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.rules-list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.rules-list li { position: relative; padding-left: 22px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.rules-list li::before { content: ''; position: absolute; left: 4px; top: 0.65em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.rules-list.tips li::before { background: var(--good); }

/* лот-образец */
.lot-mock { display: flex; flex-direction: column; align-items: center; }
.lot-mock-card { --rarity: #eb4b4b; width: min(300px, 100%); padding: 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--rarity) 70%, #000); background: linear-gradient(180deg, color-mix(in srgb, var(--rarity) 22%, #141a23), #121720 60%); box-shadow: 0 0 36px color-mix(in srgb, var(--rarity) 28%, transparent); }
.lot-mock-img { height: 72px; display: flex; align-items: center; justify-content: center; color: color-mix(in srgb, var(--rarity) 60%, #b8c4d4); }
.rifle { width: 130px; height: 52px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
.lot-mock-tags { display: flex; gap: 4px; justify-content: center; margin: 6px 0; }
.lot-mock-name { text-align: center; font-size: 18px; font-weight: 800; }
.lot-mock-name small { display: block; font-size: 11px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.lot-mock-hidden { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.lot-mock-hidden > div { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; }
.lot-mock-hidden span { display: block; font-size: 9px; letter-spacing: 0.14em; color: var(--muted); }
.lot-mock-hidden b { display: block; font-size: 15px; letter-spacing: 0.2em; color: #4c5a6e; }

/* бюджет, слоты, лоты */
.chips-fig { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.chip-fig { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.chip-fig b { font-size: 20px; }
.chip-fig small { font-size: 11px; color: var(--muted); }

/* схема торгов */
.seq { display: block; width: 100%; max-width: 440px; margin: 0 auto; height: auto; }
.seq-lane { fill: var(--text); font-size: 15px; font-weight: 700; }
.seq-line { stroke: var(--line); stroke-dasharray: 4 4; }
.seq-arrow { stroke: var(--accent); stroke-width: 2; }
.seq-head { fill: var(--accent); }
.seq-label { fill: var(--muted); font-size: 13.5px; }
.seq-pass { fill: rgba(255, 107, 94, 0.14); stroke: var(--bad); }
.seq-pass-text { fill: var(--bad); font-size: 15px; font-weight: 800; letter-spacing: 0.08em; }
.seq-win { fill: rgba(95, 212, 138, 0.12); stroke: var(--good); }
.seq-win-text { fill: var(--good); font-size: 16px; font-weight: 800; }

/* слоты */
.slots-fig { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.slots-fig > div { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.slots-row { display: flex; gap: 6px; }
.slots-row .s { width: 30px; height: 30px; border-radius: 8px; border: 1px dashed var(--line); background: var(--panel); }
.slots-row .s.on { border: 1px solid #4b69ff; background: linear-gradient(180deg, rgba(75, 105, 255, 0.45), rgba(75, 105, 255, 0.12)); }

/* переплата и находка */
.bars-fig { display: grid; gap: 16px; }
.bar-row { display: grid; gap: 6px; }
.bar-name { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.bar-track { position: relative; height: 26px; border-radius: 7px; background: var(--panel); overflow: hidden; }
.bar { position: absolute; inset: 0 auto 0 0; width: var(--w, 100%); border-radius: 7px; }
.bar.paid { background: linear-gradient(90deg, var(--accent2), var(--accent)); }
.bar.real { background: linear-gradient(90deg, #2e9c5d, var(--good)); }
.bar-track em { position: absolute; left: 10px; top: 0; line-height: 26px; font-style: normal; font-size: 12px; font-weight: 700; color: #04111f; mix-blend-mode: normal; text-shadow: 0 0 6px rgba(255, 255, 255, 0.25); }
/* у коротких столбцов подпись уходит вправо от столбца */
.bar-track.short em { left: calc(var(--w) + 12px); color: var(--text); text-shadow: none; }

/* деньги */
.money-fig { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.money-box { display: flex; flex-direction: column; align-items: center; padding: 10px 14px; border-radius: 10px; font-weight: 800; font-size: 13px; border: 1px solid var(--line); background: var(--panel); }
.money-box small { font-size: 11px; color: var(--gold); font-weight: 700; }
.money-box.lose { color: var(--bad); border-color: rgba(255, 107, 94, 0.4); }
.money-box.win { color: var(--good); border-color: rgba(95, 212, 138, 0.45); }
.money-arrow { color: var(--muted); font-size: 12px; font-weight: 700; }

@media (max-width: 700px) {
  .guide { padding: 0; align-items: stretch; }
  .guide-box { width: 100%; max-height: none; height: 100%; border-radius: 0; border: 0; }
  .guide-body { padding: 16px; }
  .step { grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
  .step-num { width: 28px; height: 28px; font-size: 13px; }
  .chips-fig { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slots-fig { grid-template-columns: 1fr; }
  .online { padding: 3px 9px 3px 8px; }
  .appbar-left { gap: 8px; }
  .guide-text small { display: none; }
}
