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

body {
font-family: 'Montserrat', 'Gotham', sans-serif;
background: #ffffff;
color: #1a1a1a;
line-height: 1.5;
}

.topbar {
background: #000000;
color: #ffffff;
position: sticky;
top: 0;
z-index: 100;
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.topbar-inner {
max-width: 1200px;
margin: 0 auto;
padding: 0 24px;
height: 64px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 24px;
}

.brand {
color: #ffffff;
text-decoration: none;
font-size: 22px;
font-weight: 800;
letter-spacing: -0.5px;
}

.nav {
display: flex;
gap: 4px;
}

.nav-btn {
background: transparent;
border: none;
color: #cccccc;
font-family: inherit;
font-size: 14px;
font-weight: 600;
padding: 8px 16px;
border-radius: 8px;
cursor: pointer;
transition: all 0.15s;
}

.nav-btn:hover {
background: rgba(255,255,255,0.1);
color: #ffffff;
}

.nav-btn.active {
background: #ffffff;
color: #000000;
}

.nav-btn.ghost {
border: 1px solid #444;
}

.auth-area {
display: flex;
align-items: center;
gap: 12px;
}

.user-chip {
color: #00d4aa;
font-size: 14px;
font-weight: 600;
}

.container {
max-width: 1200px;
margin: 0 auto;
padding: 32px 24px;
}

.panel {
display: none;
}

.panel.active {
display: block;
}

.panel-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 24px;
}

.panel-header h1 {
font-size: 32px;
font-weight: 800;
letter-spacing: -0.5px;
}

.refresh-btn {
background: #f0f0f0;
border: 1px solid #ddd;
color: #333;
font-family: inherit;
font-size: 13px;
font-weight: 600;
padding: 8px 16px;
border-radius: 8px;
cursor: pointer;
}

.refresh-btn:hover {
background: #e5e5e5;
}

.grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
gap: 20px;
}

.loading {
grid-column: 1 / -1;
text-align: center;
color: #888;
padding: 48px;
font-size: 15px;
}

.card {
background: #ffffff;
border: 1px solid #e8e8e8;
border-radius: 12px;
padding: 20px;
transition: all 0.2s;
cursor: pointer;
}

.card:hover {
box-shadow: 0 4px 16px rgba(0,0,0,0.08);
transform: translateY(-2px);
border-color: #d0d0d0;
}

.card-title {
font-size: 18px;
font-weight: 700;
margin-bottom: 6px;
color: #1a1a1a;
}

.card-meta {
font-size: 13px;
color: #888;
}

.card-tag {
display: inline-block;
background: #f0f0f0;
color: #555;
font-size: 11px;
font-weight: 600;
padding: 3px 10px;
border-radius: 12px;
margin-top: 8px;
text-transform: uppercase;
letter-spacing: 0.5px;
}

.author-link {
color: #0066cc;
text-decoration: none;
font-weight: 600;
cursor: pointer;
}

.author-link:hover {
text-decoration: underline;
}

.play-btn {
background: #000000;
color: #ffffff;
border: none;
font-family: inherit;
font-size: 13px;
font-weight: 700;
padding: 8px 18px;
border-radius: 6px;
cursor: pointer;
margin-top: 12px;
display: block;
width: 100%;
}

.play-btn:hover {
background: #222;
transform: translateY(-1px);
}

.game-card {
cursor: pointer;
}

.catalog-card {
text-align: center;
}

.catalog-img {
width: 128px;
height: 128px;
margin: 0 auto 12px;
border: 1px solid #e8e8e8;
border-radius: 8px;
background: #f0f0f0;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}

.catalog-img img {
max-width: 100%;
max-height: 100%;
image-rendering: pixelated;
}

.user-card {
text-align: center;
}

.user-avatar {
width: 64px;
height: 64px;
border-radius: 50%;
background: linear-gradient(135deg, #00d4aa, #0088cc);
margin: 0 auto 12px;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
font-weight: 800;
color: #ffffff;
}

.user-name {
font-size: 16px;
font-weight: 700;
margin-bottom: 4px;
}

.user-bio {
font-size: 13px;
color: #888;
margin-bottom: 8px;
min-height: 19px;
}

.user-followers {
font-size: 12px;
color: #666;
}

.create-form {
max-width: 480px;
background: #fafafa;
border: 1px solid #e8e8e8;
border-radius: 12px;
padding: 28px;
}

.form-tabs {
display: flex;
gap: 4px;
margin-bottom: 24px;
background: #ffffff;
border: 1px solid #e8e8e8;
border-radius: 8px;
padding: 4px;
}

.form-tab {
flex: 1;
background: transparent;
border: none;
font-family: inherit;
font-size: 13px;
font-weight: 600;
padding: 10px;
border-radius: 6px;
cursor: pointer;
color: #666;
}

.form-tab.active {
background: #000000;
color: #ffffff;
}

.form-section h3 {
font-size: 18px;
font-weight: 700;
margin-bottom: 16px;
}

.input {
width: 100%;
font-family: inherit;
font-size: 14px;
padding: 12px 14px;
border: 1px solid #ddd;
border-radius: 8px;
margin-bottom: 12px;
background: #ffffff;
color: #1a1a1a;
outline: none;
}

.input:focus {
border-color: #000000;
}

textarea.input {
min-height: 80px;
resize: vertical;
}

.primary-btn {
background: #000000;
color: #ffffff;
border: none;
font-family: inherit;
font-size: 14px;
font-weight: 700;
padding: 12px 24px;
border-radius: 8px;
cursor: pointer;
width: 100%;
}

.primary-btn:hover {
background: #222;
transform: translateY(-1px);
}

.form-status {
font-size: 13px;
margin-top: 12px;
min-height: 18px;
}

.form-status.ok { color: #00875a; }
.form-status.err { color: #de350b; }

.hint {
font-size: 13px;
color: #888;
padding: 16px;
background: #ffffff;
border-radius: 8px;
border: 1px dashed #ddd;
}

.file-label {
display: block;
font-size: 13px;
font-weight: 600;
color: #555;
margin-bottom: 6px;
}

.file-input {
width: 100%;
font-family: inherit;
font-size: 13px;
padding: 8px;
border: 1px solid #ddd;
border-radius: 8px;
margin-bottom: 12px;
background: #ffffff;
}

.image-preview {
width: 128px;
height: 128px;
margin: 0 auto 12px;
border: 1px solid #ddd;
border-radius: 8px;
background: #f0f0f0;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}

.image-preview img {
max-width: 100%;
max-height: 100%;
image-rendering: pixelated;
}

.image-preview:empty::before {
content: 'No image';
color: #aaa;
font-size: 12px;
}

.avatar-preview {
width: 96px;
height: 96px;
margin: 0 auto 12px;
border: 1px solid #ddd;
border-radius: 50%;
background: #f0f0f0;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}

.avatar-preview img {
width: 100%;
height: 100%;
object-fit: cover;
}

.avatar-preview:empty::before {
content: 'No avatar';
color: #aaa;
font-size: 11px;
}

.item-detail {
max-width: 600px;
margin: 0 auto;
background: #fafafa;
border: 1px solid #e8e8e8;
border-radius: 16px;
padding: 40px;
text-align: center;
}

.item-detail-img {
width: 200px;
height: 200px;
margin: 0 auto 24px;
border: 2px solid #e8e8e8;
border-radius: 12px;
background: #fff;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}

.item-detail-img img {
max-width: 100%;
max-height: 100%;
image-rendering: pixelated;
}

.item-detail h2 {
font-size: 28px;
font-weight: 800;
margin-bottom: 8px;
}

.item-detail .item-type {
display: inline-block;
background: #f0f0f0;
color: #555;
font-size: 12px;
font-weight: 600;
padding: 4px 12px;
border-radius: 12px;
margin-bottom: 16px;
text-transform: uppercase;
letter-spacing: 0.5px;
}

.item-detail .item-author {
font-size: 14px;
color: #888;
margin-bottom: 24px;
}

.item-detail .item-author a {
color: #0066cc;
text-decoration: none;
font-weight: 600;
}

.buy-btn {
background: #00875a;
color: #ffffff;
border: none;
font-family: inherit;
font-size: 16px;
font-weight: 700;
padding: 14px 32px;
border-radius: 8px;
cursor: pointer;
width: 100%;
margin-top: 8px;
transition: all 0.15s;
}

.buy-btn:hover {
background: #006644;
transform: translateY(-1px);
}

.buy-btn:disabled {
background: #999;
cursor: not-allowed;
transform: none;
}

.buy-btn.owned {
background: #f0f0f0;
color: #555;
border: 1px solid #ddd;
}

.item-price {
font-size: 24px;
font-weight: 800;
color: #00875a;
margin: 16px 0;
}

.edit-profile-btn {
background: #000;
color: #fff;
border: none;
font-family: inherit;
font-size: 12px;
font-weight: 600;
padding: 6px 14px;
border-radius: 6px;
cursor: pointer;
margin-top: 12px;
}

.avatar-layout {
display: grid;
grid-template-columns: 220px 1fr;
gap: 32px;
align-items: start;
}

.avatar-preview-big {
width: 200px;
height: 200px;
border-radius: 50%;
background: linear-gradient(135deg, #00d4aa, #0088cc);
margin: 0 auto 16px;
display: flex;
align-items: center;
justify-content: center;
font-size: 72px;
font-weight: 800;
color: #fff;
overflow: hidden;
border: 3px solid #e8e8e8;
}

.avatar-preview-big img {
width: 100%;
height: 100%;
object-fit: cover;
}

.avatar-preview-big.has-img {
background: transparent;
}

.avatar-info {
text-align: center;
}

.avatar-info h2 {
font-size: 22px;
font-weight: 800;
margin-bottom: 4px;
}

.avatar-info .bio {
font-size: 13px;
color: #666;
margin-bottom: 12px;
}

.avatar-section h3 {
font-size: 18px;
font-weight: 800;
margin-bottom: 16px;
}

.equipped-item {
display: flex;
align-items: center;
gap: 16px;
padding: 16px;
background: #fafafa;
border: 1px solid #e8e8e8;
border-radius: 12px;
margin-bottom: 12px;
}

.equipped-item-img {
width: 64px;
height: 64px;
border: 1px solid #ddd;
border-radius: 8px;
background: #fff;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
flex-shrink: 0;
}

.equipped-item-img img {
max-width: 100%;
max-height: 100%;
image-rendering: pixelated;
}

.equipped-item-info {
flex: 1;
}

.equipped-item-info .name {
font-weight: 700;
font-size: 15px;
}

.equipped-item-info .type {
font-size: 12px;
color: #888;
text-transform: capitalize;
}

.unequip-btn {
background: #de350b;
color: #fff;
border: none;
font-family: inherit;
font-size: 12px;
font-weight: 700;
padding: 8px 14px;
border-radius: 6px;
cursor: pointer;
}

.empty-state {
text-align: center;
padding: 32px;
color: #888;
font-size: 14px;
}

.inventory-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
gap: 12px;
}

.inventory-card {
background: #fafafa;
border: 1px solid #e8e8e8;
border-radius: 8px;
padding: 12px;
text-align: center;
cursor: pointer;
transition: all 0.15s;
}

.inventory-card:hover {
border-color: #000;
transform: translateY(-2px);
}

.inventory-card.equipped {
border-color: #00875a;
background: #f0fff4;
}

.inventory-card-img {
width: 80px;
height: 80px;
margin: 0 auto 8px;
border: 1px solid #ddd;
border-radius: 4px;
background: #fff;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}

.inventory-card-img img {
max-width: 100%;
max-height: 100%;
image-rendering: pixelated;
}

.inventory-card .name {
font-size: 12px;
font-weight: 600;
color: #1a1a1a;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.inventory-card .tag {
font-size: 10px;
color: #888;
text-transform: capitalize;
margin-top: 2px;
}

.inventory-card .equipped-badge {
display: inline-block;
background: #00875a;
color: #fff;
font-size: 9px;
font-weight: 700;
padding: 2px 6px;
border-radius: 3px;
margin-top: 4px;
text-transform: uppercase;
}

@media (max-width: 768px) {
.avatar-layout { grid-template-columns: 1fr; }
}

.profile-header {
display: flex;
align-items: center;
gap: 24px;
padding: 32px;
background: #fafafa;
border: 1px solid #e8e8e8;
border-radius: 16px;
margin-bottom: 32px;
}

.profile-avatar {
width: 96px;
height: 96px;
border-radius: 50%;
background: linear-gradient(135deg, #00d4aa, #0088cc);
display: flex;
align-items: center;
justify-content: center;
font-size: 36px;
font-weight: 800;
color: #ffffff;
flex-shrink: 0;
}

.profile-info h2 {
font-size: 28px;
font-weight: 800;
margin-bottom: 6px;
}

.profile-bio {
font-size: 14px;
color: #666;
margin-bottom: 12px;
}

.profile-stats {
display: flex;
gap: 24px;
font-size: 14px;
color: #555;
}

.profile-stats strong {
font-weight: 800;
color: #1a1a1a;
}

.follow-btn {
background: #000000;
color: #ffffff;
border: none;
font-family: inherit;
font-size: 13px;
font-weight: 700;
padding: 8px 18px;
border-radius: 6px;
cursor: pointer;
margin-left: auto;
}

.follow-btn.following {
background: #f0f0f0;
color: #333;
border: 1px solid #ddd;
}

.back-btn {
background: #f0f0f0;
border: 1px solid #ddd;
font-family: inherit;
font-size: 13px;
font-weight: 600;
padding: 8px 16px;
border-radius: 8px;
cursor: pointer;
}

.modal {
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0,0,0,0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 200;
}

.modal-content {
background: #ffffff;
border-radius: 12px;
padding: 32px;
width: 90%;
max-width: 400px;
position: relative;
}

.close {
position: absolute;
top: 16px;
right: 20px;
font-size: 28px;
cursor: pointer;
color: #999;
line-height: 1;
}

.auth-tabs {
display: flex;
gap: 4px;
margin-bottom: 24px;
background: #f0f0f0;
border-radius: 8px;
padding: 4px;
}

.auth-tab {
flex: 1;
background: transparent;
border: none;
font-family: inherit;
font-size: 13px;
font-weight: 600;
padding: 10px;
border-radius: 6px;
cursor: pointer;
color: #666;
}

.auth-tab.active {
background: #ffffff;
color: #000000;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
.topbar-inner { padding: 0 16px; gap: 8px; }
.brand { font-size: 18px; }
.nav-btn { padding: 6px 10px; font-size: 13px; }
.container { padding: 20px 16px; }
.panel-header h1 { font-size: 24px; }
.grid { grid-template-columns: 1fr; }
.profile-header { flex-direction: column; text-align: center; }
}
