body {
    background-color: #1b1e23;
    color: #e9e9e9;
    font-family: 'Poppins', sans-serif;
    margin: 0;
}
.container {
    width: 90%;
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
}
.navbar {
    background-color: #0e1114;
    border-bottom: 2px solid #ffc107;
}
.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
}
.brand {
    color: #ffc107;
    font-weight: bold;
    text-decoration: none;
}
.nav-links {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.nav-links a {
    color: #e9e9e9;
    margin-left: 15px;
    text-decoration: none;
}
.coins {
    margin-right: 15px;
}

/* Coins badge next to username */
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}
.user-menu .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}
.user-menu .username { color: #e9e9e9; }
.coins-badge {
    background: #2d3136;
    color: #ffd700;
    border: 1px solid #444;
    padding: 4px 10px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
}
.coins-badge:hover {
    background: #353a40;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
table th, table td {
    border: 1px solid #444;
    padding: 8px;
    text-align: left;
}
button, .btn {
    background-color: #ffc107;
    color: #1b1e23;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: var(--cursor-pointer, pointer);
    text-decoration: none;
    display: inline-block;
    transition: background-color .2s, transform .1s;
}
button:hover, .btn:hover {
    background-color: #e0a800;
    transform: translateY(-2px);
}
button:disabled, .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.search-form {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.store-tabs {
    margin-top: 20px;
}

.store-tabs a {
    margin-right: 10px;
    text-decoration: none;
    color: #e9e9e9;
}

.store-tabs a.active {
    font-weight: 600;
    color: #ffc107;
}

.search-form input[type="text"] {
    flex: 1;
    padding: 6px;
    border: 1px solid #444;
    background-color: #2d3136;
    color: #e9e9e9;
}

.skin-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.skin-item {
    box-sizing: border-box;
    width: calc(33.333% - 20px);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    background-color: rgba(255,255,255,0.02);
    transition: transform .2s;
    display: flex;
    flex-direction: column;
    position: relative;
    /* Mantém altura uniforme entre os cards */
    height: 320px;
}

/* Coins store tiles */
.coins-pack .coins-amount {
    font-size: 1.4em;
    color: #ffd700;
    margin: 8px 0 4px;
}
.coins-pack .coins-desc {
    color: #cfcfcf;
    margin-bottom: 10px;
}

.skin-item:hover {
    transform: translateY(-2px);
}

.skin-item img,
.skin-item video {
    width: 100%;
    height: 150px;
    object-fit: contain;
    display: block;
}

.media-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.media-wrapper {
    position: relative;
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    display: none;
}

.skin-name {
    margin-top: 10px;
    line-height: 1.3;
    /* Trunca nomes longos para manter proporção dos cards */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em; /* ~2 linhas */
}
.skin-rarity {
    font-size: 0.9em;
    margin-top: 4px;
    min-height: 1.2em;
}

.skin-extra {
    font-size: 0.8em;
    margin-top: 4px;
    min-height: 1.2em;
}

/* Empurra as ações para a base do card para layout consistente */
.skin-item form { margin-top: auto; }

/* Informação de item já possuído (quando existir) */
.owned-info {
    color: #cfcfcf;
    font-size: 0.9em;
    min-height: 1.2em;
}

/* Responsivo: quebra para 2 colunas em telas menores */
@media (max-width: 900px) {
    .skin-item { width: calc(50% - 20px); }
}
@media (max-width: 520px) {
    .skin-item { width: 100%; height: auto; }
}

.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination a,
.pagination span {
    color: #e9e9e9;
    margin: 0 5px;
    text-decoration: none;
    display: inline-block;
    padding: 4px 8px;
    border: 1px solid #444;
    border-radius: 4px;
}
.pagination span.ellipsis {
    border: none;
}

.case-container {
    position: relative;
    overflow: hidden;
    width: 600px;
    margin: 40px auto;
    border: 2px solid #444;
    border-radius: 8px;
    background-color: #000;
}
.case-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: #ffc107;
    transform: translateX(-50%);
    z-index: 10;
}

.case-strip {
    display: flex;
}

.case-item-box {
    position: relative;
    width: 100px;
    height: 80px;
    border-right: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 100px;
}
.case-item {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.float-label {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7em;
    color: #fff;
}

.case-result {
    text-align: center;
    margin-top: 20px;
}

/* fixed-size container for result images */
.result-img {
    width: 300px;
    height: 300px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.pagination a.active {
    font-weight: bold;
    background-color: #ffc107;
    color: #1b1e23;
}

.pagination a.prev,
.pagination a.next {
    font-weight: bold;
}

.case-actions {
    text-align: center;
    margin-top: 10px;
}

.case-actions button {
    margin: 0 10px;
}

/* Rarity colors */
.rarity-consumer   { background-color: rgba(176,195,217,0.1); border-left: 4px solid #b0c3d9; color: #b0c3d9; }
.rarity-industrial { background-color: rgba(94,152,217,0.1); border-left: 4px solid #5e98d9; color: #5e98d9; }
.rarity-milspec    { background-color: rgba(75,105,255,0.1); border-left: 4px solid #4b69ff; color: #4b69ff; }
.rarity-restricted { background-color: rgba(136,71,255,0.1); border-left: 4px solid #8847ff; color: #8847ff; }
.rarity-classified { background-color: rgba(211,44,230,0.1); border-left: 4px solid #d32ce6; color: #d32ce6; }
.rarity-covert     { background-color: rgba(235,75,75,0.1); border-left: 4px solid #eb4b4b; color: #eb4b4b; }
.rarity-contraband { background-color: rgba(255,215,0,0.1); border-left: 4px solid #ffd700; color: #ffd700; }
.rarity-distinguished { background-color: rgba(75,105,255,0.1); border-left: 4px solid #4b69ff; color: #4b69ff; }
.rarity-exceptional { background-color: rgba(136,71,255,0.1); border-left: 4px solid #8847ff; color: #8847ff; }
.rarity-superior { background-color: rgba(211,44,230,0.1); border-left: 4px solid #d32ce6; color: #d32ce6; }
.rarity-master { background-color: rgba(235,75,75,0.1); border-left: 4px solid #eb4b4b; color: #eb4b4b; }

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #1b1e23;
    border: 1px solid #444;
    padding: 20px;
    text-align: center;
}

#stSelectModal .modal-content {
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
}

#stSelectModal .skin-grid {
    /* keep existing behavior */
    max-height: 60vh;
    overflow-y: auto;
}

/* Name Tag selection modal layout: fixed 3-column grid */
#ntSelectModal .modal-content {
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
}
#ntSelectModal .skin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-height: 60vh;
    overflow-y: auto;
    align-items: start;
}
#ntSelectModal .skin-item { width: auto; }
#ntSelectModal .filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#stSelectModal .filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-buttons button {
    margin: 0 10px;
}

#stModal .stattrak-modal {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

#stModal .stattrak-modal form {
    margin-top: 10px;
}

#stModal .stattrak-modal #stSelected {
    margin-top: 10px;
}

/* Equipped badge */
.equipped-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: bold;
    background-color: #ffc107;
    color: #1b1e23;
}
.equipped-badge.ct { background-color: #007bff; color: #fff; }
.equipped-badge.tr { background-color: #d9534f; color: #fff; }
.stattrack-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: bold;
    background-color: #ff6a00;
    color: #fff;
}

.slot-row {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    justify-content: center;
}

.apply-sticker-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.skin-preview img {
    width: 200px;
    height: 200px;
    object-fit: contain;
}

.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.sticker-slot {
    width: 64px;
    height: 64px;
    border: 2px dashed #444;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sticker-slot img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.sticker-slot button.add {
    width: 100%;
    height: 100%;
    font-size: 32px;
    background: none;
    color: #ffc107;
}
.sticker-slot .remove {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #d9534f;
    color: #fff;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: var(--cursor-pointer, pointer);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 14px;
    line-height: 1;
}

#stickerModal .modal-content.sticker-select {
    width: 60%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

#stickerModal .sticker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
}

#stickerModal .no-stickers {
    padding: 20px;
    text-align: center;
}

#stickerModal .sticker-option {
    border: 1px solid #444;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    background-color: rgba(255,255,255,0.02);
    cursor: var(--cursor-pointer, pointer);
}

#stickerModal .sticker-option img {
    width: 100%;
    height: 80px;
    object-fit: contain;
}

.applied-stickers {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 6px 0 10px;
}
.applied-stickers .slot {
    width: 48px;
    height: 48px;
    border: 1px solid #555;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}
.applied-stickers .slot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .2s;
}
.applied-stickers .slot:hover img {
    transform: scale(1.2);
}
.applied-stickers .slot.empty {
    background: transparent;
}

[data-name] {
    position: relative;
}
[data-name]::after {
    content: attr(data-name);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
    z-index: 10;
}
[data-name]:hover::after {
    opacity: 1;
}

.equipped-tags {
    display: flex;
    gap: 4px;
    position: absolute;
    top: 6px;
    right: 6px;
    margin: 0;
}

.item-actions {
    margin-top: auto;
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* Name Tag line: match .skin-extra */
.nametag-line {
    margin-top: 4px;
    font-size: 0.8em;
    line-height: 1.4;
}

.item-actions form {
    margin: 0;
}

.skin-item .equip-form {
    margin-top: auto;
}

.skin-item.selectable {
    cursor: var(--cursor-pointer, pointer);
    position: relative; /* anchor radio in top-right of the card */
}

.skin-item.selectable input[type="radio"] {
    position: absolute;
    top: 8px;
    right: 8px;
}

.skin-item.selectable.selected {
    border-color: #fff;
}

/* Admin panel navigation */
.admin-nav {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.admin-nav a {
    background-color: #2d3136;
    color: #e9e9e9;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color .2s, transform .1s;
}
.admin-nav a:hover {
    background-color: #ffc107;
    color: #1b1e23;
    transform: translateY(-2px);
}

/* Admin sections */
.admin-card {
    background: #2d3136;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 14px 16px;
    margin: 12px 0;
}
.admin-card h3 { margin: 0 0 8px 0; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); gap: 16px; }

input[type="text"], input[type="number"], select {
    padding: 6px;
    border: 1px solid #444;
    background-color: #2d3136;
    color: #e9e9e9;
    border-radius: 4px;
}

#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.toast {
    background: #2d3136;
    color: #e9e9e9;
    padding: 10px 16px;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.toast.success { background: #28a745; }
.toast.error   { background: #dc3545; }

.user-menu {
    display: flex;
    align-items: center;
    margin-left: auto;
    position: relative;
}

.user-menu .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-top: 10px;
}

/* Avatar upload clickable area */
.avatar-upload {
    position: relative;
    display: inline-block;
    cursor: var(--cursor-pointer, pointer);
}
.avatar-upload input[type="file"] { display: none; }
.avatar-upload .avatar-preview {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid #444;
}
.avatar-upload .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.0);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.95em;
    font-weight: 600;
    letter-spacing: .3px;
    opacity: 0;
    transition: opacity .2s, background .2s;
    pointer-events: none;
}
.avatar-upload:hover .overlay {
    opacity: 1;
    background: rgba(0,0,0,0.35);
}

/* Profile form layout */
.form-card {
    background: #2d3136;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 16px 18px;
    max-width: 560px;
}
.form-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.form-row label { width: 100px; color: #cfcfcf; }
.form-row .field { flex: 1; }
.form-actions { margin-top: 12px; }

/* Preferences grid */
.prefs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin: 14px 0 20px;
}
.prefs-tile {
    display: block;
    background: #2d3136;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 14px;
    color: #e9e9e9;
    text-decoration: none;
    transition: background .2s, transform .1s, border-color .2s;
}
.prefs-tile:hover { background: #353a40; transform: translateY(-1px); border-color: #555; }
.prefs-tile .title { font-weight: 600; margin-bottom: 4px; }
.prefs-tile .desc { opacity: .8; font-size: .9em; }
.prefs-tile.active { border-color: #ffc107; box-shadow: 0 0 0 1px #ffc107 inset; }

.user-menu .username {
    margin-left: 8px;
    cursor: var(--cursor-pointer, pointer);
}

.user-info .dropdown {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 8px);
    background: #2d3136;
    border: 1px solid #444;
    border-radius: 4px;
    min-width: 140px;
    z-index: 100;
}

.user-info:hover .dropdown,
.user-info.open .dropdown {
    display: block;
}

.user-info .dropdown a {
    display: block;
    padding: 8px 12px;
    color: #e9e9e9;
    text-decoration: none;
}

.user-info .dropdown a:hover {
    background: #ffc107;
    color: #1b1e23;
}

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

.server-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #2d3136;
    color: #e9e9e9;
}

.server-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.server-card .info {
    padding: 10px;
}

.server-card .copy-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: #ffc107;
    color: #1b1e23;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: var(--cursor-pointer, pointer);
}
