@font-face {
    font-family: 'Monocraft';
    src: url('/static/Monocraft.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background: #111;
    color: #eee;
}

main {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
    align-items: flex-start;
}

.sidebar {
    flex-basis: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-island {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
}

.profile-island h2 {
    margin-top: 0;
}

.data-value {
    font-weight: 700;
    font-family: 'Monocraft', monospace;
    color: #d1d5db;
    word-break: break-word;
    white-space: normal;
    font-size: 0.8rem;
}

#rank {
    font-size: 0.8rem;
    font-family: 'Monocraft', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

#rank span {
    white-space: normal;
    display: inline;
}

.store-content {
    flex-grow: 1;
}

button {
    width: 100%;
    display: inline-block;
    padding: 0.75rem 1rem;
    background: #444;
    color: #eee;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

button:hover {
    background: #666;
}

.hidden {
    display: none !important;
}

#profile-avatar-container {
    position: relative;
    margin-top: 20px;
    text-align: center;
}

#profile-avatar-container img {
    width: 100px;
    height: auto;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    z-index: 4;
}

.above-wrapper {
    text-align: center;
}

.above-name {
    display: inline-flex;
    gap: 0.25rem;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background-color: #000000b6;
}

.avatar-shadow {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 15px;
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
    filter: blur(4px);
    pointer-events: none;
    z-index: 3;
}

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

.card {
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
}

.card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.card-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h2 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.card-content p {
    margin-bottom: 1rem;
    color: #ccc;
    font-size: 0.95rem;
}

.features {
    padding-left: 20px;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.card-buttons {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.card-buttons button {
    flex: 1;
    padding: 0.5rem;
    background: #444;
    border: none;
    color: #eee;
    border-radius: 4px;
    cursor: pointer;
}

.card-buttons button:hover {
    background: #666;
}

@media (max-width: 900px) {
    main {
        flex-direction: column;
    }
    .sidebar {
        flex-basis: auto;
        width: 100%;
    }
}

.cart-island {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 20px;
}

.cart-island h2 {
    margin-top: 0;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #333;
    gap: 10px;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-details {
    flex-grow: 1;
}

.cart-item-details .item-name {
    font-weight: 600;
}

.cart-item-details .item-recipient {
    font-size: 0.85rem;
    color: #9ca3af;
}

.cart-item-price {
    font-weight: 600;
    color: #d1d5db;
    white-space: nowrap;
    margin-top: 2px;
}

.cart-item button {
    width: auto;
    padding: 4px 8px;
    font-size: 0.8rem;
    background-color: #7f1d1d;
    margin-top: 2px;
}
.cart-item button:hover {
    background-color: #991b1b;
}

#checkout-button {
    margin-top: 20px;
    background-color: #166534;
}
#checkout-button:hover {
    background-color: #15803d;
}

dialog {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    color: #eee;
    padding: 20px;
    width: 90%;
    max-width: 400px;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
}

dialog h2 {
    margin-top: 0;
}

dialog p {
    color: #9ca3af;
}

dialog input[type="text"],
dialog input[type="color"],
dialog textarea {
    width: 100%;
    padding: 0.75rem;
    background: #111;
    border: 1px solid #444;
    color: #eee;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

dialog input[type="color"] {
    padding: 0.25rem;
    height: 40px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

#gift-modal .username-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 10px;
}

#gift-modal .username-wrapper input {
    flex-grow: 1;
}

#gift-minecraft-head {
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
    border-radius: 4px;
    background-color: #111;
}

.error-message {
    color: #ef4444;
    font-size: 0.9rem;
    margin-top: 10px;
    margin-bottom: 0;
}

.price-container {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.original-price {
    text-decoration: line-through;
    color: #6b7280;
    font-size: 1rem;
    font-weight: 400;
}

.final-price {
    color: #4ade80;
}

.card-image-container {
    position: relative;
}

.sale-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #dc2626;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.form-field {
    margin-top: 15px;
}

.form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #d1d5db;
}

.item-metadata {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-top: 5px;
    padding-left: 10px;
    border-left: 2px solid #444;
}
.item-metadata strong {
    color: #b0b7c4;
    text-transform: capitalize;
}
.item-metadata code {
    background-color: #2c2c2c;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
}
.color-preview {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #555;
    vertical-align: middle;
    margin-right: 4px;
}

.discord-field {
    margin-top: 20px;
}

.discord-field label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #9ca3af;
}

.discord-field input {
    width: 100%;
    padding: 0.75rem;
    background: #111;
    border: 1px solid #444;
    color: #eee;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

footer {
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    color: #9ca3af;
}

footer a {
    color: #ccd4e2;
    text-decoration: none;
}