/* ===== People ============================================================ */
.avatar { display: inline-block; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: none; background: #2a2f3a; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.avatar svg { display: block; width: 100%; height: 100%; }
.avatar-sm { width: 30px; height: 30px; }
.avatar-lg { width: 44px; height: 44px; border-radius: 12px; }
.avatar-xl { width: 76px; height: 76px; border-radius: 18px; }

.lvl {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  min-width: 22px; height: 18px; padding: 0 5px; border-radius: 5px;
  font-size: 11px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.07); color: #aab2c0;
}
.lvl-1 { background: rgba(127, 214, 131, 0.13); color: #8fe093; }
.lvl-2 { background: rgba(214, 196, 66, 0.15); color: #e7d15a; }
.lvl-3 { background: rgba(76, 141, 255, 0.16); color: #7eb0ff; }
.lvl-4 { background: rgba(155, 107, 255, 0.18); color: #bb9bff; }
.lvl-5 { background: rgba(255, 77, 94, 0.17); color: #ff8592; }
.lvl-6 { background: linear-gradient(90deg, rgba(255, 198, 26, 0.3), rgba(255, 140, 0, 0.25)); color: #ffe38a; box-shadow: inset 0 0 0 1px rgba(255, 198, 26, 0.35); }

/* ===== Item tile ========================================================= */
.item {
  --rc: #8b93a4;
  position: relative; display: flex; flex-direction: column;
  padding: 10px 10px 12px; border-radius: 11px; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(120% 70% at 50% 108%, color-mix(in srgb, var(--rc) 30%, transparent), transparent 70%),
    linear-gradient(180deg, #232731, #1d2028);
  border: 1px solid var(--line);
  transition: transform 0.18s var(--ease), border-color 0.18s, box-shadow 0.18s;
}
.item::after { content: ''; position: absolute; left: 14%; right: 14%; bottom: 0; height: 2px; border-radius: 2px; background: var(--rc); box-shadow: 0 0 12px var(--rc); opacity: 0.9; }
.item:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--rc) 45%, transparent); }
.item-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 18px; font-size: 11px; color: var(--muted); font-weight: 600; }
.wear-tag { display: inline-flex; align-items: center; gap: 4px; }
.wear-tag i { font-style: normal; color: var(--muted-2); font-weight: 500; font-family: var(--mono); font-size: 10px; }
.st { color: #ff8a3d; font-weight: 700; }
.item-odds { color: var(--text-2); background: rgba(0, 0, 0, 0.3); padding: 2px 6px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.item-img { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; margin: 2px 0 6px; }
.item-img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5)); transition: transform 0.25s var(--ease); }
.item:hover .item-img img { transform: scale(1.06) rotate(-2deg); }
.item-meta { min-width: 0; }
.item-weapon { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-price { margin-top: 6px; font-size: 13.5px; }
.item-price .amt { color: #fff; }
.item.selectable { cursor: pointer; }
.item.selected { border-color: var(--yellow); box-shadow: 0 0 0 1px var(--yellow), 0 0 22px -6px rgba(255, 198, 26, 0.6); }
.item.selected::before { content: ''; position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 50%; z-index: 2;
  background: var(--yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23241900' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat; }
.item.disabled { opacity: 0.4; pointer-events: none; }
.item-actions { display: flex; gap: 6px; margin-top: 8px; }
.item-actions .btn { flex: 1; height: 30px; font-size: 12px; padding: 0 8px; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
.item-grid.sm { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.item-grid.sm .item { padding: 8px 8px 10px; }
.item-grid.sm .item-name { font-size: 12px; }

/* ===== Case cards ======================================================== */
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }
.case-card {
  position: relative; display: flex; flex-direction: column; align-items: center;
  padding: 14px 14px 16px; border-radius: 14px; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(90% 55% at 50% 62%, color-mix(in srgb, var(--c1) 16%, transparent), transparent 72%),
    linear-gradient(180deg, #20242c, #1b1e25);
  border: 1px solid var(--line);
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.case-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c1) 45%, transparent); box-shadow: 0 16px 34px -14px color-mix(in srgb, var(--c1) 55%, transparent); }
.case-card .case-visual { width: 100%; }
.case-name { margin-top: 4px; font-weight: 700; font-size: 15px; text-align: center; }
.case-price { margin-top: 8px; padding: 6px 12px; border-radius: 8px; background: rgba(0, 0, 0, 0.32); border: 1px solid var(--line); font-size: 14px; }
.case-card:hover .case-price { background: linear-gradient(180deg, #2fd56f, #1ea955); border-color: transparent; }
.case-tag { position: absolute; top: 10px; left: 10px; z-index: 3; padding: 3px 8px; border-radius: 6px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; background: rgba(76, 141, 255, 0.2); color: #9cc0ff; }
.case-tag.hot { background: rgba(255, 77, 94, 0.2); color: #ff98a2; }
.case-tag.gold { background: rgba(255, 198, 26, 0.18); color: var(--yellow); }

.case-visual { position: relative; aspect-ratio: 200 / 180; }
.case-visual .crate { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.case-visual .case-hero {
  position: absolute; left: 50%; top: 12%; width: 74%; transform: translate(-50%, 0) rotate(-14deg);
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 18px color-mix(in srgb, var(--c1) 45%, transparent));
  transition: transform 0.35s var(--ease);
  pointer-events: none;
}
.case-card:hover .case-hero, .case-visual:hover .case-hero { transform: translate(-50%, -8%) rotate(-8deg) scale(1.05); }

/* ===== Reel (case spinner) =============================================== */
.reel { position: relative; overflow: hidden; border-radius: 12px; background: linear-gradient(180deg, #15171c, #191c22); border: 1px solid var(--line); }
.reel-h { height: calc(var(--cell) + 28px); }
.reel-track { position: absolute; left: 0; top: 0; display: flex; gap: var(--gap); will-change: transform; }
.reel-h .reel-track { top: 14px; flex-direction: row; }
.reel-v .reel-track { left: 50%; margin-left: calc(var(--cell) / -2); flex-direction: column; }
.reel-cell {
  --rc: #8b93a4;
  position: relative; flex: none; width: var(--cell); height: var(--cell);
  border-radius: 10px; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(80% 60% at 50% 100%, color-mix(in srgb, var(--rc) 34%, transparent), transparent 75%), #20242c;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: opacity 0.3s, transform 0.35s var(--ease), box-shadow 0.3s;
}
.reel-cell img { width: 86%; height: 86%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55)); pointer-events: none; }
.reel-bar { position: absolute; left: 12%; right: 12%; bottom: 0; height: 3px; border-radius: 3px; background: var(--rc); box-shadow: 0 0 12px var(--rc); }
.reel-marker { position: absolute; z-index: 3; pointer-events: none; }
.reel-h .reel-marker { left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; background: var(--yellow); box-shadow: 0 0 14px rgba(255, 198, 26, 0.8); }
.reel-h .reel-marker::before, .reel-h .reel-marker::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); border: 8px solid transparent; }
.reel-h .reel-marker::before { top: 0; border-top-color: var(--yellow); }
.reel-h .reel-marker::after { bottom: 0; border-bottom-color: var(--yellow); }
.reel-v .reel-marker { top: 50%; left: 0; right: 0; height: 3px; margin-top: -1.5px; background: var(--yellow); box-shadow: 0 0 14px rgba(255, 198, 26, 0.8); }
.reel-v .reel-marker::before, .reel-v .reel-marker::after { content: ''; position: absolute; top: 50%; transform: translateY(-50%); border: 7px solid transparent; }
.reel-v .reel-marker::before { left: 0; border-left-color: var(--yellow); }
.reel-v .reel-marker::after { right: 0; border-right-color: var(--yellow); }
.reel-shade { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.reel-h .reel-shade { background: linear-gradient(90deg, #15171c 0%, transparent 18%, transparent 82%, #15171c 100%); }
.reel-v .reel-shade { background: linear-gradient(180deg, #15171c 0%, transparent 24%, transparent 76%, #15171c 100%); }
.reel.done .reel-cell:not(.win) { opacity: 0.32; }
.reel-cell.win { transform: scale(1.06); box-shadow: 0 0 0 2px var(--rc), 0 0 30px -4px var(--rc); z-index: 1; }

/* ===== Toasts ============================================================ */
.toasts { position: fixed; top: calc(var(--topbar-h) + 12px); right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; max-width: 360px;
  padding: 11px 14px; border-radius: 11px; background: #232731; border: 1px solid var(--line-2);
  box-shadow: var(--shadow); font-size: 13.5px; color: var(--text-2); cursor: pointer;
  opacity: 0; transform: translateX(20px); transition: opacity 0.22s, transform 0.22s var(--ease);
}
.toast.in { opacity: 1; transform: none; }
.toast a { color: var(--yellow); font-weight: 600; text-decoration: underline; }
.toast b { color: #fff; }
.toast-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(76, 141, 255, 0.18); color: var(--blue); }
.toast-ic .ic { width: 13px; height: 13px; stroke-width: 3; }
.toast-msg { padding-top: 1px; }
.toast-msg .amt { color: #fff; }
.toast-success .toast-ic { background: rgba(36, 198, 97, 0.18); color: var(--green-1); }
.toast-error .toast-ic { background: rgba(255, 77, 94, 0.18); color: var(--red); }
.toast-gold { border-color: rgba(255, 198, 26, 0.4); background: linear-gradient(90deg, rgba(255, 198, 26, 0.12), #232731 60%); }
.toast-gold .toast-ic { background: rgba(255, 198, 26, 0.2); color: var(--yellow); }

/* ===== Modal ============================================================= */
.modal-overlay {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px;
  background: rgba(6, 7, 10, 0.7); backdrop-filter: blur(3px); opacity: 0; transition: opacity 0.18s;
}
.modal-overlay.in { opacity: 1; }
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  background: #1e2129; border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transform: translateY(10px) scale(0.98); transition: transform 0.2s var(--ease);
}
.modal-overlay.in .modal { transform: none; }
.modal-sm { width: min(420px, 100%); }
.modal-lg { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 0 20px; }
.modal-head h3 { font-size: 18px; flex: 1; }
.modal-body { padding: 14px 20px 20px; }
.modal-text { color: var(--text-2); line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 20px 20px; }

/* ===== Dropdown menu ===================================================== */
.menu {
  position: fixed; z-index: 120; min-width: 200px; padding: 6px;
  background: #23262f; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(-4px); transition: opacity 0.15s, transform 0.15s var(--ease);
}
.menu.in { opacity: 1; transform: none; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: 13.5px; text-align: left; }
.menu-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.menu-item .ic { color: var(--muted); }
.menu-item:hover .ic { color: var(--yellow); }
.menu-div { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-user { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; }
.menu-user b { display: block; color: #fff; }
.menu-user > div > span { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }

/* ===== Bet control ======================================================= */
.bet-control { display: flex; flex-direction: column; gap: 8px; }
.bet-input { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border-radius: 10px; background: var(--bg-1); border: 1px solid var(--line-2); }
.bet-input:focus-within { border-color: rgba(255, 198, 26, 0.5); }
.bet-input .coin { width: 20px; height: 20px; }
.bet-input input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; font-size: 17px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.bet-quick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.bet-quick button { height: 30px; border-radius: 7px; background: var(--bg-4); color: var(--muted); font-size: 12px; font-weight: 600; }
.bet-quick button:hover { color: #fff; background: var(--bg-5); }

/* ===== Tabs ============================================================== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tabs a:hover, .tabs button:hover { color: #fff; }
.tabs .on { color: #fff; border-bottom-color: var(--yellow); }

/* ===== Tables ============================================================ */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-2); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* ===== Misc ============================================================== */
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 300; }
.drawer-scrim { position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 65; background: rgba(0, 0, 0, 0.5); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
body.chat-drawer .drawer-scrim { opacity: 1; pointer-events: auto; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.stat { padding: 14px 16px; border-radius: 12px; background: var(--bg-3); border: 1px solid var(--line); }
.stat > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.stat b { font-size: 18px; display: flex; align-items: center; gap: 6px; }
.progress { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--yellow), #ffe58a); }
.wallet-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.wallet-row b .amt { font-size: 16px; }
.wallet p { margin: 14px 0; line-height: 1.6; }
.wallet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.settings { display: flex; flex-direction: column; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.set-row:last-child { border-bottom: 0; }
.set-row span { display: flex; flex-direction: column; gap: 2px; }
.set-row small { color: var(--muted); font-size: 12px; }
.set-row .input { width: 180px; }
.set-row.danger b { color: var(--red); }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; color: #fff; list-style: none; display: flex; justify-content: space-between; }
.faq summary::after { content: '+'; color: var(--muted); font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq p { margin-top: 8px; color: var(--text-2); line-height: 1.6; }
.verify-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.verify-chip .ic { width: 14px; height: 14px; color: var(--green-1); }
.verify-chip a { color: var(--text-2); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.25); }
