* { margin: 0; padding: 0; box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgba(56,189,248,0.2) transparent; }
html, body { overflow-x: hidden; max-width: 100vw; }

body {
    font-family: -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: #0a0c10;
    color: #e2e8f0;
    line-height: 1.6;
}

header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid rgba(56, 189, 248, 0.15);
    text-align: center;
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.05) 0%, transparent 100%);
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; color: #38bdf8; text-shadow: 0 0 20px rgba(56, 189, 248, 0.3); }

/* Language Switcher */
.lang-switcher-inline {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    z-index: 100;
}
.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 6px;
    color: #7dd3fc;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.lang-btn:hover { border-color: rgba(56, 189, 248, 0.5); color: #e2e8f0; box-shadow: 0 0 10px rgba(56, 189, 248, 0.15); }

.lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.375rem;
    background: #0d1117;
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 6px;
    padding: 0.25rem;
    min-width: 140px;
    z-index: 100;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
.lang-dropdown.open { display: flex; flex-direction: column; }

.lang-dropdown a {
    padding: 0.375rem 0.625rem;
    font-size: 0.8rem;
    color: #888;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.1s;
}
.lang-dropdown a:hover { background: rgba(56, 189, 248, 0.1); color: #e2e8f0; text-decoration: none; }
.lang-dropdown a.active { color: #38bdf8; font-weight: 600; }

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card {
    background: rgba(56, 189, 248, 0.03);
    border-radius: 10px;
    padding: 1.5rem;
    border: 1px solid rgba(56, 189, 248, 0.12);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.card h2 {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1.25rem;
    color: #7dd3fc;
    text-align: center;
}

a { color: #38bdf8; text-decoration: none; }
a:hover { text-decoration: underline; color: #7dd3fc; }
.back { color: #555; font-size: 0.875rem; }
.back:hover { color: #e2e8f0; }
.muted { color: #555; }
.nav-link { color: #7dd3fc; }

/* Stats */
.detail-stats, .stat-row {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 1rem;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: #38bdf8; }
.stat-label { font-size: 0.75rem; color: #555; text-transform: uppercase; letter-spacing: 0.05em; }

/* Filters */
.filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.label-tabs, .sort-tabs { display: flex; gap: 0.375rem; flex-wrap: wrap; }

.label-tab, .sort-tab {
    padding: 0.375rem 0.75rem;
    background: rgba(56, 189, 248, 0.04);
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #555;
    text-decoration: none;
    transition: all 0.15s;
}
.label-tab:hover, .sort-tab:hover { color: #e2e8f0; border-color: rgba(56, 189, 248, 0.4); text-decoration: none; }
.label-tab.active { border-color: #38bdf8; color: #38bdf8; background: rgba(56, 189, 248, 0.1); box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.15); }
.sort-tab.active { border-color: #38bdf8; color: #38bdf8; background: rgba(56, 189, 248, 0.1); }

.label-tab.label-limited { border-color: rgba(251, 191, 36, 0.3); }
.label-tab.label-limited.active { color: #fbbf24; background: rgba(251, 191, 36, 0.1); border-color: #fbbf24; }

.tab-count { font-weight: 400; opacity: 0.7; margin-left: 0.25rem; }

/* Search */
.search-bar { margin-bottom: 0.75rem; display: flex; justify-content: center; }
.search-bar input {
    width: 100%;
    max-width: 420px;
    padding: 0.5rem 0.75rem;
    background: rgba(56, 189, 248, 0.04);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.search-bar input:focus { border-color: #38bdf8; background: rgba(56, 189, 248, 0.08); }
.search-bar input::placeholder { color: rgba(56, 189, 248, 0.35); }

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.item-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(56, 189, 248, 0.03);
    border: 1px solid rgba(56, 189, 248, 0.1);
    border-radius: 10px;
    padding: 1rem 0.75rem;
    text-decoration: none;
    color: #e2e8f0;
    position: relative;
    transition: all 0.2s;
}
.item-card:hover {
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateY(-2px);
    text-decoration: none;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.1);
}

.item-label-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    letter-spacing: 0.05em;
}
.label-limited { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.label-shop { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; }

.item-img {
    width: 96px;
    height: 72px;
    object-fit: contain;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 2px 8px rgba(56, 189, 248, 0.15));
}

.item-img-placeholder {
    width: 96px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d1b2a, #0a0c10);
    border-radius: 6px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #38bdf8;
    margin-bottom: 0.5rem;
}

.item-name {
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 0.25rem;
}
.item-name a { color: #e2e8f0; }
.item-name a:hover { color: #38bdf8; text-decoration: none; }
.item-name[data-steam-url] { cursor: pointer; }

.item-type {
    font-size: 0.625rem;
    color: #444;
    margin-bottom: 0.375rem;
}

.item-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #38bdf8;
    margin-bottom: 0.125rem;
}

.item-spark {
    width: 100%;
    height: 28px;
    margin-bottom: 0.25rem;
}

.item-roi-row {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.roi-badge {
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.0625rem 0.375rem;
    border-radius: 3px;
}
.roi-pos { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.roi-neg { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.item-volume {
    font-size: 0.625rem;
    color: #444;
    margin-top: 0.25rem;
}

/* ROI Calculator */
.roi-calc {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
}
.calc-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.calc-row label {
    font-size: 0.875rem;
    color: #8a8a8a;
    min-width: 100px;
}
.calc-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: rgba(56, 189, 248, 0.04);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.875rem;
}
.calc-input:focus { outline: none; border-color: #38bdf8; box-shadow: 0 0 8px rgba(56, 189, 248, 0.15); }
.calc-result {
    padding: 0.75rem;
    background: rgba(56, 189, 248, 0.04);
    border-radius: 6px;
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Snapshots */
.snapshots-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 300px;
    overflow-y: auto;
}
.snap-row {
    display: flex;
    gap: 1rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    border-radius: 4px;
}
.snap-row:hover { background: rgba(56, 189, 248, 0.05); }

/* Cookie Popup */
.cookie-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.cookie-popup {
    background: #0d1117;
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 12px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.cookie-popup h3 { color: #38bdf8; margin-bottom: 0.75rem; }
.cookie-popup p { color: #888; font-size: 0.8125rem; line-height: 1.5; margin-bottom: 1rem; }
.cookie-buttons { display: flex; gap: 0.75rem; justify-content: center; }
.cookie-buttons button {
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}
.btn-accept {
    background: #38bdf8;
    color: #000;
    border-color: #38bdf8;
}
.btn-accept:hover { background: #0ea5e9; box-shadow: 0 0 12px rgba(56, 189, 248, 0.3); }
.btn-decline {
    background: transparent;
    color: #888;
    border-color: rgba(56, 189, 248, 0.2);
}
.btn-decline:hover { border-color: rgba(56, 189, 248, 0.4); color: #e2e8f0; }

/* Mobile */
@media (max-width: 768px) {
    header { padding: 1rem; }
    main { padding: 1rem; gap: 1rem; }
    .card { padding: 1rem; }
    .items-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .filters { flex-direction: column; align-items: flex-start; }
    .label-tabs, .sort-tabs { flex-wrap: wrap; }
    .detail-stats { flex-wrap: wrap; gap: 1rem; }
    .stat-value { font-size: 1.25rem; }
    .search-bar input { max-width: 100%; }
}

@media (max-width: 480px) {
    .items-grid { grid-template-columns: 1fr 1fr; }
}
