:root {
    --bg: #0a0e17;
    --bg-card: #111827;
    --bg-elevated: #1a2234;
    --border: #1f2937;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --primary: #f97316;
    --primary-hover: #ea580c;
    --accent: #6366f1;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #eab308;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,.4);
    --header-h: 64px;
    --font: 'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* Event banner */
.event-banner {
    background: linear-gradient(90deg, var(--event-color, var(--accent)), #1e1b4b);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: .875rem;
}
.event-badge {
    background: rgba(255,255,255,.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: .75rem;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10,14,23,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--header-h);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--header-h);
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; flex-shrink: 0; }
.logo-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), #dc2626);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 900;
}
.logo-text { display: none; }
@media (min-width: 480px) { .logo-text { display: inline; } }

.nav-toggle {
    display: flex; flex-direction: column; gap: 5px;
    padding: 8px; margin-left: auto;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }
@media (min-width: 900px) { .nav-toggle { display: none; } }

.nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px;
    gap: 4px;
    z-index: 99;
}
.nav.open { display: flex; }
.nav a {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    transition: .15s;
}
.nav a:hover, .nav a.active { background: var(--bg-elevated); color: var(--text); }
@media (min-width: 900px) {
    .nav {
        display: flex; flex-direction: row; position: static;
        background: none; border: none; padding: 0; gap: 4px;
        margin-left: 16px;
    }
    .nav a { padding: 8px 12px; font-size: .875rem; }
}

.header-actions {
    display: flex; align-items: center; gap: 8px;
}
@media (max-width: 899px) {
    .header-actions { display: none; }
    .nav.open + .header-actions,
    .header-inner:has(.nav.open) .header-actions {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        padding: 12px 16px;
        justify-content: center;
        flex-wrap: wrap;
        z-index: 99;
    }
}

.wallet { display: flex; gap: 8px; }
.wallet-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    display: flex; flex-direction: column;
    line-height: 1.2;
}
.wallet-item.credits { border-color: rgba(249,115,22,.3); }
.wallet-item.points { border-color: rgba(99,102,241,.3); }
.wallet-label { font-size: .65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.wallet-item strong { font-size: .85rem; }

.user-menu { position: relative; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    color: #fff; font-weight: 700; font-size: .875rem;
}
.dropdown {
    display: none;
    position: absolute; right: 0; top: calc(100% + 8px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 160px;
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 200;
}
.dropdown.open { display: block; }
.dropdown a {
    display: block; padding: 10px 16px;
    font-size: .875rem; color: var(--text-muted);
    transition: .15s;
}
.dropdown a:hover { background: var(--bg-elevated); color: var(--text); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: .875rem;
    transition: .15s; border: 1px solid transparent;
    white-space: nowrap;
}
.btn-xs { padding: 4px 10px; font-size: .7rem; }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #4f46e5; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn-ghost:hover { border-color: var(--text-muted); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* Main */
.main { padding: 24px 0 48px; min-height: calc(100vh - var(--header-h) - 120px); }

/* Hero */
.hero {
    padding: 48px 0;
    text-align: center;
    background: radial-gradient(ellipse at 50% 0%, rgba(249,115,22,.12), transparent 60%);
}
.hero h1 { font-size: clamp(1.75rem, 5vw, 3rem); font-weight: 800; margin-bottom: 12px; }
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 560px; margin: 0 auto 24px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Section */
.section { margin-bottom: 40px; }
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.section-header h2 { font-size: 1.25rem; font-weight: 700; }

/* Cards grid */
.grid { display: grid; gap: 16px; }
.grid-cases { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.grid-skins { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.grid-battles { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-stats { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: .2s;
}
.card:hover { border-color: #374151; transform: translateY(-2px); }
.card-body { padding: 16px; }
.card-img {
    aspect-ratio: 1;
    background: var(--bg-elevated);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.card-img img { max-height: 100%; object-fit: contain; }
.card-title { font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.card-meta { color: var(--text-muted); font-size: .8rem; }
.card-price { color: var(--primary); font-weight: 700; margin-top: 8px; }

/* Rarity colors */
.rarity-bar { height: 3px; width: 100%; }
.rarity-consumer { --rarity: #b0c3d9; }
.rarity-industrial { --rarity: #5e98d9; }
.rarity-mil-spec { --rarity: #4b69ff; }
.rarity-restricted { --rarity: #8847ff; }
.rarity-classified { --rarity: #d32ce6; }
.rarity-covert { --rarity: #eb4b4b; }
.rarity-extraordinary { --rarity: #e4ae39; }
.rarity-bar { background: var(--rarity, #b0c3d9); }

.skin-card .card-img { aspect-ratio: 4/3; }
.skin-card .rarity-tag {
    font-size: .65rem; font-weight: 600; text-transform: uppercase;
    color: var(--rarity, #b0c3d9); letter-spacing: .04em;
}

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: 6px; color: var(--text-muted); }
.form-control {
    width: 100%; padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text); font-size: .9rem;
    transition: .15s;
}
.form-control:focus { outline: none; border-color: var(--primary); }
select.form-control { cursor: pointer; }

.auth-box {
    max-width: 420px; margin: 40px auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}
.auth-box h1 { font-size: 1.5rem; margin-bottom: 8px; }
.auth-box p { color: var(--text-muted); margin-bottom: 24px; font-size: .9rem; }

/* Alerts */
.alert {
    padding: 12px 16px; border-radius: var(--radius-sm);
    margin: 16px 0; font-size: .875rem;
}
.alert-success { background: rgba(34,197,94,.15); border: 1px solid rgba(34,197,94,.3); color: #86efac; }
.alert-error { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; }
.alert-info { background: rgba(99,102,241,.15); border: 1px solid rgba(99,102,241,.3); color: #a5b4fc; }
.alert-warning { background: rgba(234,179,8,.15); border: 1px solid rgba(234,179,8,.3); color: #fde047; }

/* Case opener */
/* ruletka na całą szerokość, zawartość skrzynki pod nią */
.opener-layout {
    display: grid;
    gap: 32px;
}
.opener-contents h3 { margin-bottom: 16px; }

.roulette-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    overflow: hidden;
}
.roulette-viewport {
    position: relative;
    height: 140px;
    overflow: hidden;
    margin: 16px 0;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
}
.roulette-track {
    display: flex;
    gap: 8px;
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    transition: none;
}
.roulette-item {
    flex-shrink: 0;
    width: 120px; height: 110px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 8px;
}
.roulette-item img { height: 60px; object-fit: contain; }
.roulette-item span { font-size: .65rem; text-align: center; margin-top: 4px; color: var(--text-muted); }
.roulette-pointer {
    position: absolute;
    top: 0; bottom: 0; left: 50%;
    width: 3px;
    background: var(--primary);
    transform: translateX(-50%);
    z-index: 2;
    box-shadow: 0 0 12px var(--primary);
}
.roulette-pointer::before, .roulette-pointer::after {
    content: '';
    position: absolute; left: 50%; transform: translateX(-50%);
    border: 8px solid transparent;
}
.roulette-pointer::before { top: 0; border-top-color: var(--primary); }
.roulette-pointer::after { bottom: 0; border-bottom-color: var(--primary); }

.opener-controls {
    display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.count-selector { display: flex; gap: 4px; }
.count-btn {
    width: 40px; height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 600;
}
.count-btn.active, .count-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(249,115,22,.1); }

.win-popup {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.8);
    display: none; align-items: center; justify-content: center;
    z-index: 1000; padding: 16px;
}
.win-popup.show { display: flex; }
.win-content {
    background: var(--bg-card);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    max-width: 400px;
    animation: popIn .4s ease;
}
@keyframes popIn {
    from { transform: scale(.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.win-content img { height: 120px; margin: 16px auto; }
.win-content h2 { color: var(--primary); margin-bottom: 8px; }

/* Battles */
.battle-card { padding: 16px; }
.battle-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 12px; }
.battle-type {
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    padding: 3px 8px; border-radius: 4px;
    background: rgba(99,102,241,.2); color: #a5b4fc;
}
.battle-status { font-size: .75rem; color: var(--text-muted); }
.battle-players-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.battle-player-slot {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px dashed var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700;
}
.battle-player-slot.filled { border-style: solid; border-color: var(--accent); }

.battle-detail { display: grid; gap: 24px; }
@media (min-width: 768px) { .battle-detail { grid-template-columns: 1fr 1fr; } }
.battle-rounds { display: flex; flex-direction: column; gap: 16px; }
.battle-round {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.battle-round h4 { font-size: .875rem; color: var(--text-muted); margin-bottom: 12px; }
.battle-drops-row { display: flex; gap: 12px; flex-wrap: wrap; }
.battle-drop {
    text-align: center; width: 100px;
}
.battle-drop img { height: 60px; margin: 0 auto 4px; }
.battle-drop .value { font-size: .75rem; color: var(--primary); font-weight: 600; }

/* Exchange */
.exchange-layout { display: grid; gap: 24px; }
@media (min-width: 900px) { .exchange-layout { grid-template-columns: 1fr 1fr; } }
.exchange-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.exchange-panel h3 { margin-bottom: 16px; font-size: 1rem; }
.inventory-select { max-height: 400px; overflow-y: auto; }
.inventory-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px; border-radius: var(--radius-sm);
    cursor: pointer; transition: .15s;
    border: 1px solid transparent;
}
.inventory-item:hover { background: var(--bg-elevated); }
.inventory-item.selected { border-color: var(--primary); background: rgba(249,115,22,.08); }
.inventory-item img { width: 64px; height: 48px; object-fit: contain; }
.inventory-item-info { flex: 1; min-width: 0; }
.inventory-item-info strong { display: block; font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inventory-item-info span { font-size: .75rem; color: var(--text-muted); }

.exchange-summary {
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 16px; margin-top: 16px;
}
.exchange-summary .row {
    display: flex; justify-content: space-between;
    padding: 6px 0; font-size: .875rem;
}
.exchange-summary .row.total { font-weight: 700; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; }

/* Stats */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}
.stat-card .value { font-size: 1.75rem; font-weight: 800; color: var(--primary); }
.stat-card .label { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: rgba(255,255,255,.02); }

/* Tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; flex-wrap: wrap; }
.tab {
    padding: 8px 16px; border-radius: var(--radius-sm);
    font-size: .875rem; font-weight: 500;
    color: var(--text-muted); border: 1px solid transparent;
}
.tab.active, .tab:hover { background: var(--bg-elevated); color: var(--text); border-color: var(--border); }

/* Recharge */
.recharge-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.recharge-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}
.recharge-card.featured { border-color: var(--primary); }
.recharge-card .amount { font-size: 2rem; font-weight: 800; color: var(--primary); }
.recharge-card p { color: var(--text-muted); font-size: .875rem; margin: 8px 0 16px; }
.cooldown { font-size: .8rem; color: var(--warning); margin-top: 8px; }

/* Leaderboard */
.rank-badge {
    width: 28px; height: 28px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .75rem;
}
.rank-1 { background: #eab308; color: #000; }
.rank-2 { background: #94a3b8; color: #000; }
.rank-3 { background: #b45309; color: #fff; }

/* Empty state */
.empty-state {
    text-align: center; padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state h2 { color: var(--text); margin-bottom: 8px; }

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    margin-top: auto;
}
.footer-inner {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px;
}
.footer p { color: var(--text-muted); font-size: .875rem; margin-top: 4px; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); font-size: .875rem; }
.footer-links a:hover { color: var(--text); }

/* Badge */
.badge {
    display: inline-block; padding: 2px 8px;
    border-radius: 4px; font-size: .7rem; font-weight: 600;
}
.badge-waiting { background: rgba(234,179,8,.2); color: #fde047; }
.badge-active { background: rgba(34,197,94,.2); color: #86efac; }
.badge-finished { background: rgba(148,163,184,.2); color: #cbd5e1; }

/* Profile */
.profile-header {
    display: flex; align-items: center; gap: 20px;
    margin-bottom: 32px; flex-wrap: wrap;
}
.profile-avatar {
    width: 80px; height: 80px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 800; color: #fff;
}

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-btn {
    padding: 6px 14px; border-radius: 20px;
    font-size: .8rem; font-weight: 500;
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.filter-btn.active, .filter-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Loading */
.spinner {
    width: 24px; height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .6s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Utility */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* Admin panel */
.admin-wrap { display: grid; gap: 24px; }
@media (min-width: 900px) {
    .admin-wrap { grid-template-columns: 220px 1fr; align-items: start; }
}
.admin-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    position: sticky;
    top: calc(var(--header-h) + 16px);
}
.admin-brand { font-weight: 800; color: var(--warning); margin-bottom: 16px; font-size: .9rem; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav a {
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--text-muted); font-size: .875rem; font-weight: 500;
}
.admin-nav a:hover, .admin-nav a.active { background: var(--bg-elevated); color: var(--text); }
.admin-nav a.admin-back { margin-top: 12px; color: var(--primary); }
.admin-content { min-width: 0; }
.admin-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}
.admin-grid-2 { display: grid; gap: 20px; }
@media (min-width: 1000px) { .admin-grid-2 { grid-template-columns: 1fr 1fr; } }
.admin-table table { font-size: .8rem; }
.admin-table th, .admin-table td { padding: 8px 10px; }
.admin-thumb { width: 48px; height: 36px; object-fit: contain; }
.admin-preview-img { max-height: 120px; object-fit: contain; border-radius: var(--radius-sm); background: var(--bg-elevated); padding: 8px; }
.admin-check { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: .875rem; cursor: pointer; }
.admin-search { display: flex; gap: 8px; max-width: 400px; }
.admin-filter-row {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px;
}
.admin-filter-row .form-control { flex: 1 1 160px; min-width: 140px; margin: 0; }
.admin-inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.admin-skin-picker { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; }
.admin-skin-option {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: .8rem;
}
.admin-skin-option:hover { background: var(--bg-elevated); }
.admin-skin-option img { width: 40px; height: 30px; object-fit: contain; }
.admin-event-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.form-control-sm { padding: 6px 10px; font-size: .8rem; }
.card-img img { width: 100%; height: auto; max-height: 140px; object-fit: contain; }

/* ============ Ruletka (skrzynki + bitwy) ============ */
.reels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 16px 0;
}
.reels.reels-multi {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}
.reel {
    position: relative;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    overflow: hidden;
}
.reel-viewport {
    position: relative;
    height: 134px;
    overflow: hidden;
}
.reel-vertical .reel-viewport { height: 260px; }
.reel-track {
    display: flex;
    gap: 8px;
    position: absolute;
    left: 0; top: 0;
    padding: 8px;
    will-change: transform;
}
.reel-vertical .reel-track { flex-direction: column; right: 0; }
.reel-item {
    flex-shrink: 0;
    width: 120px; height: 118px;
    background: var(--bg-card);
    border: 2px solid var(--rc, var(--border));
    border-bottom-width: 4px;
    border-radius: var(--radius-sm);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 6px;
    transition: box-shadow .3s ease, transform .3s ease;
}
.reel-vertical .reel-item { width: auto; height: 104px; }
.reel-item img { height: 62px; object-fit: contain; }
.reel-vertical .reel-item img { height: 54px; }
.reel-item span {
    font-size: .62rem; text-align: center; margin-top: 4px;
    color: var(--text-muted);
    max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.reel-item.winner {
    box-shadow: 0 0 22px var(--rc), inset 0 0 22px rgba(255,255,255,.08);
    transform: scale(1.04);
}
.reel-pointer {
    position: absolute;
    z-index: 3;
    background: var(--primary);
    box-shadow: 0 0 14px var(--primary);
    top: 0; bottom: 0; left: 50%;
    width: 3px;
    transform: translateX(-50%);
}
.reel-vertical .reel-pointer {
    top: 50%; bottom: auto; left: 0; right: 0;
    width: auto; height: 3px;
    transform: translateY(-50%);
}
.reel::before, .reel::after {
    content: '';
    position: absolute; z-index: 2;
    pointer-events: none;
}
.reel::before { inset: 0 auto 0 0; width: 60px; background: linear-gradient(90deg, var(--bg-elevated), transparent); }
.reel::after { inset: 0 0 0 auto; width: 60px; background: linear-gradient(270deg, var(--bg-elevated), transparent); }
.reel-vertical::before { inset: 0 0 auto 0; width: auto; height: 50px; background: linear-gradient(180deg, var(--bg-elevated), transparent); }
.reel-vertical::after { inset: auto 0 0 0; width: auto; height: 50px; background: linear-gradient(0deg, var(--bg-elevated), transparent); }
.reel.spinning { box-shadow: inset 0 0 0 1px rgba(249,115,22,.35); }
.reel.landed { animation: reelPulse .5s ease; }
@keyframes reelPulse {
    0% { box-shadow: 0 0 0 rgba(249,115,22,0); }
    40% { box-shadow: 0 0 26px rgba(249,115,22,.45); }
    100% { box-shadow: 0 0 0 rgba(249,115,22,0); }
}

.fast-toggle {
    display: flex; align-items: center; gap: 6px;
    font-size: .8125rem; color: var(--text-muted); cursor: pointer;
}

.opener-cost {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
    margin-top: 12px; font-size: .875rem;
}
.opener-cost strong { color: var(--accent); font-size: 1rem; }
.opener-cost .cost-missing { color: var(--danger); }

/* Podsumowanie wygranych */
.win-content { max-width: 640px; width: 100%; }
.win-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin: 16px 0;
    max-height: 50vh; overflow-y: auto;
}
.win-item {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    padding: 8px;
    animation: popIn .35s ease backwards;
}
.win-item img { height: 60px; object-fit: contain; margin: 0 auto; }
.win-item-name { font-size: .68rem; margin-top: 6px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-item-price { font-size: .8rem; font-weight: 700; color: var(--primary); }
.win-total { font-size: 1.05rem; margin-top: 8px; }
.win-total strong { color: var(--success); }
.win-sell-btn { width: 100%; margin-top: 6px; }
.win-item.sold { opacity: .4; filter: grayscale(1); }
.win-sell-status { font-size: .8125rem; margin-top: 10px; min-height: 1.2em; color: var(--success); }

/* ============ Sprzedaż skinów ============ */
.sell-bar {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
}
.sell-bar-info { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .875rem; }
.sell-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.skin-card.selectable { cursor: pointer; }
.skin-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary) inset;
}
.skin-card.selected .card-body::before {
    content: '✓ Zaznaczony';
    display: block; font-size: .7rem; font-weight: 700;
    color: var(--primary); margin-bottom: 4px;
}
.skin-card.locked { opacity: .65; }
.skin-card.sold { opacity: .35; filter: grayscale(1); }
.sell-one { width: 100%; }

/* ============ Arena bitwy ============ */
.battle-arena {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 24px;
}
.arena-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.arena-round { font-size: .8125rem; color: var(--text-muted); }
.arena-winner {
    background: linear-gradient(90deg, rgba(234,179,8,.18), transparent);
    border-left: 3px solid var(--warning);
    padding: 10px 14px; border-radius: var(--radius-sm);
    margin-bottom: 12px;
    animation: popIn .4s ease;
}
.arena-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}
.arena-col {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    transition: opacity .4s ease, border-color .4s ease;
}
.arena-col.is-winner { border-color: var(--warning); box-shadow: 0 0 20px rgba(234,179,8,.25); }
.arena-col.is-loser { opacity: .55; }
/* aktualnie prowadzący — słabsze podświetlenie niż finalny zwycięzca */
.arena-col.is-leading { border-color: var(--success); box-shadow: 0 0 14px rgba(34,197,94,.2); }
.arena-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.arena-crown { display: none; margin-left: auto; font-size: .9rem; }
.arena-col.is-leading .arena-crown { display: inline; }
.arena-chance {
    text-align: center; font-size: .7rem; font-weight: 700;
    color: var(--accent); margin: -4px 0 6px;
}
.battle-head-actions {
    display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
    flex-shrink: 0;
}
.arena-leader { font-size: .8125rem; color: var(--text-muted); margin-top: 4px; min-height: 1.2em; }
.arena-leader strong { color: var(--text); }
.lead-hint { font-size: .72rem; opacity: .75; }
.arena-avatar {
    width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center;
    font-size: .75rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.arena-name { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arena-total {
    text-align: center; font-weight: 700; color: var(--primary);
    margin: 8px 0; font-size: .95rem;
    transition: transform .2s ease;
}
.arena-total.bump { transform: scale(1.18); color: var(--success); }
.arena-items { display: flex; flex-wrap: wrap; gap: 4px; }
.arena-item {
    width: 44px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px;
    text-align: center;
    animation: popIn .3s ease;
}
.arena-item img { height: 26px; object-fit: contain; }
.arena-item span { font-size: .55rem; color: var(--text-muted); }
.arena-winner-sub { font-size: .8rem; color: var(--text-muted); }

/* Wyniki odsłaniane w rytm animacji */
.spoiler-hidden { visibility: hidden; }
.battle-round.spoiler-hidden { display: none; }
/* odznaka WIN nie może zostawiać pustego miejsca — puste pole zdradza zwycięzcę */
.badge.spoiler-hidden { display: none; }
.battle-round.revealed { animation: popIn .35s ease; }

/* ============ Tryby bitew ============ */
.battle-mode {
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    padding: 3px 8px; border-radius: 4px;
    background: var(--bg-elevated); color: var(--text-muted);
    letter-spacing: .03em;
}
.battle-mode.mode-standard { background: rgba(34,197,94,.16); color: #86efac; }
.battle-mode.mode-underdog { background: rgba(234,179,8,.16); color: #fde047; }
.battle-mode.mode-shared { background: rgba(99,102,241,.2); color: #a5b4fc; }

.mode-picker { display: grid; gap: 8px; }
.mode-option {
    display: block; cursor: pointer;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px; transition: .15s;
}
.mode-option:hover { border-color: var(--text-muted); }
.mode-option.active { border-color: var(--primary); background: rgba(249,115,22,.08); }
.mode-option input { margin-right: 8px; }
.mode-option strong { font-size: .875rem; }
.mode-option span { display: block; font-size: .78rem; color: var(--text-muted); margin-top: 2px; }

/* ============ Drużyny 2v2 ============ */
.team-board {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}
.team-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: 3px solid var(--team-color, var(--accent));
    border-radius: var(--radius);
    padding: 12px;
}
.team-panel.team-1, .arena-team-1 { --team-color: #3b82f6; }
.team-panel.team-2, .arena-team-2 { --team-color: #ef4444; }
.team-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 10px;
}
.team-name { font-size: .8rem; font-weight: 700; color: var(--team-color, var(--accent)); text-transform: uppercase; }
.team-total { font-weight: 700; color: var(--primary); }
.team-members { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.team-member { text-align: center; }
.team-vs { font-weight: 800; color: var(--text-muted); font-size: .9rem; }

.arena-grid-teams { grid-template-columns: 1fr auto 1fr; align-items: start; }
.arena-team {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: 3px solid var(--team-color, var(--accent));
    border-radius: var(--radius-sm);
    padding: 10px;
    transition: opacity .4s ease, border-color .4s ease, box-shadow .4s ease;
}
.arena-team.is-winner { border-color: var(--warning); box-shadow: 0 0 22px rgba(234,179,8,.22); }
.arena-team.is-loser { opacity: .6; }
.arena-team.is-leading { border-color: var(--success); box-shadow: 0 0 16px rgba(34,197,94,.18); }
.arena-team-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 10px;
}
.arena-team-name { font-size: .78rem; font-weight: 700; color: var(--team-color, var(--accent)); text-transform: uppercase; }
.arena-team-total {
    font-weight: 700; color: var(--primary); font-size: 1rem;
    transition: transform .2s ease;
}
.arena-team-total.bump { transform: scale(1.18); color: var(--success); }
.arena-team-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.arena-vs { align-self: center; font-weight: 800; color: var(--text-muted); }

@media (max-width: 720px) {
    .team-board, .arena-grid-teams { grid-template-columns: 1fr; }
    .team-vs, .arena-vs { display: none; }
}

/* ============ Diagnostyka + sync w panelu ============ */
.diag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 8px;
}
.diag-item {
    display: flex; justify-content: space-between; gap: 8px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: .78rem;
}
.diag-item span { color: var(--text-muted); }
.diag-item strong.ok { color: var(--success); }
.diag-item strong.bad { color: var(--danger); }
.sync-progress { margin-top: 16px; }
.sync-bar {
    height: 8px; background: var(--bg-elevated);
    border-radius: 999px; overflow: hidden;
}
.sync-bar-fill {
    height: 100%; width: 0;
    background: linear-gradient(90deg, var(--primary), var(--warning));
    transition: width .3s ease;
}
.sync-status { font-size: .78rem; margin-top: 8px; }

/* ============ Portfel: animacja zmiany salda i punktów ============ */
.wallet-item { position: relative; }
.wallet-bump { animation: walletBump .5s ease; }
@keyframes walletBump {
    0% { transform: scale(1); }
    35% { transform: scale(1.22); color: var(--success); }
    100% { transform: scale(1); }
}
.wallet-toast {
    position: absolute;
    left: 50%; top: -4px;
    transform: translate(-50%, 0);
    font-size: .75rem; font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    animation: walletToast 1.8s ease forwards;
}
.wallet-toast-points { color: #a5b4fc; }
.wallet-toast-credits { color: var(--primary); }
@keyframes walletToast {
    0% { opacity: 0; transform: translate(-50%, 6px); }
    20% { opacity: 1; transform: translate(-50%, -14px); }
    80% { opacity: 1; transform: translate(-50%, -22px); }
    100% { opacity: 0; transform: translate(-50%, -34px); }
}

/* ============ Tryby otwierania (normal / jester / boost) ============ */
.mode-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin: 16px 0 4px;
}
.mode-btn {
    position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: .15s;
    text-align: center;
}
.mode-btn:hover { border-color: var(--text-muted); color: var(--text); }
/* radio zostaje w DOM (wysyłka formularza), ale nie zajmuje miejsca */
.mode-radio { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.mode-icon { font-size: 1.4rem; line-height: 1; }
.mode-name { font-size: .8rem; font-weight: 700; }
.mode-mult { font-size: .68rem; opacity: .8; }
.mode-btn.active { color: var(--text); }
.mode-btn.mode-normal.active { border-color: var(--primary); background: rgba(249,115,22,.12); }
.mode-btn.mode-jester.active { border-color: #d32ce6; background: rgba(211,44,230,.12); }
.mode-btn.mode-boost.active { border-color: var(--success); background: rgba(34,197,94,.12); }
.mode-note { font-size: .78rem; min-height: 1.2em; margin-bottom: 4px; }

.drop-mode-badge {
    display: inline-block;
    font-size: .7rem; font-weight: 700;
    padding: 2px 8px; border-radius: 999px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}
.drop-mode-badge.drop-jester { color: #f0abfc; border-color: rgba(211,44,230,.45); background: rgba(211,44,230,.14); }
.drop-mode-badge.drop-boost { color: #86efac; border-color: rgba(34,197,94,.45); background: rgba(34,197,94,.14); }

/* ============ Tworzenie bitwy: wybór wielu skrzynek ============ */
.battle-create-layout { display: grid; gap: 24px; align-items: start; }
@media (min-width: 960px) {
    .battle-create-layout { grid-template-columns: 1fr 1fr; }
}

.case-picker {
    display: grid;
    gap: 6px;
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px;
    background: var(--bg-card);
}
.case-pick {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: .15s;
}
.case-pick:hover { background: var(--bg-elevated); }
.case-pick.picked { border-color: var(--primary); background: rgba(249,115,22,.08); }
.case-pick img { width: 44px; height: 34px; object-fit: contain; flex-shrink: 0; }
.case-pick-info { min-width: 0; flex: 1; }
.case-pick-name { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-pick-price { font-size: .72rem; color: var(--primary); font-weight: 600; }
.case-pick-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.qty-btn {
    width: 26px; height: 26px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-weight: 700; line-height: 1;
}
.qty-btn:hover { border-color: var(--primary); color: var(--primary); }
.qty-value { min-width: 18px; text-align: center; font-size: .8rem; font-weight: 700; }

.battle-summary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    position: sticky;
    top: calc(var(--header-h) + 16px);
}
.summary-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0;
    font-size: .875rem;
}
.summary-row strong { font-size: 1rem; color: var(--primary); }
.summary-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.summary-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 6px 3px 10px;
    font-size: .72rem;
}
.chip-remove {
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--border); color: var(--text);
    font-size: .7rem; line-height: 1;
}
.chip-remove:hover { background: var(--danger); }

/* ============ Skrzynki w bitwie ============ */
.battle-cases { display: flex; flex-wrap: wrap; gap: 8px; }
.battle-case-chip {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 12px 4px 6px;
    transition: .15s;
}
.battle-case-chip:hover { border-color: var(--primary); }
.battle-case-chip img { width: 32px; height: 26px; object-fit: contain; }
.battle-case-name { font-size: .78rem; }
.battle-case-rounds { font-size: .72rem; font-weight: 700; color: var(--primary); }

/* ============ Odliczanie przed bitwą ============ */
.arena-countdown {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 20px 0 24px;
}
.countdown-label { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.countdown-value {
    font-size: 3.5rem; font-weight: 800; line-height: 1;
    color: var(--primary);
    text-shadow: 0 0 30px rgba(249,115,22,.5);
}
.countdown-value.pulse { animation: countdownPulse .6s ease; }
@keyframes countdownPulse {
    0% { transform: scale(1.35); opacity: .4; }
    100% { transform: scale(1); opacity: 1; }
}
