/* ========================================
    SHOPPING CART STYLES
    Apple-inspired minimalist design
======================================== */

/* Cart Badge on Navigation */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ff3b30 0%, #ff2d55 100%);
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.4), 0 0 0 2px white;
    animation: bounceIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.cart-badge.updated {
    animation: pulse 0.3s ease;
}

/* Update nav icon to be relative for badge positioning */
.nav-icon {
    position: relative;
    cursor: pointer;
}

/* Cart Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9998;
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100%;
    background: var(--bg-secondary, #1d1d1f);
    box-shadow: -8px 0 40px var(--shadow-color, rgba(0, 0, 0, 0.3));
    z-index: 9999;
    transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

/* Cart Header */
.cart-header {
    padding: 28px 28px 24px;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: var(--bg-secondary, #1d1d1f);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.cart-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    margin: 0;
    letter-spacing: -0.5px;
}

.cart-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary, #a1a1a6);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cart-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary, #ffffff);
    transform: scale(1.05);
}

.cart-close:active {
    transform: scale(0.95);
}

/* Cart Body */
.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    background: var(--bg-primary, #000000);
}

.cart-body::-webkit-scrollbar {
    width: 6px;
}

.cart-body::-webkit-scrollbar-track {
    background: transparent;
}

.cart-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.cart-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Empty Cart State */
.cart-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 60px 40px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-empty-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 24px;
    opacity: 0.15;
    stroke-width: 1.5;
}

.cart-empty h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    margin: 0 0 10px 0;
    letter-spacing: -0.4px;
}

.cart-empty p {
    font-size: 16px;
    color: var(--text-secondary, #a1a1a6);
    margin: 0;
    line-height: 1.5;
}

/* Cart Items */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Cart Item */
.cart-item {
    display: flex;
    gap: 16px;
    padding: 18px;
    background: var(--bg-tertiary, #2d2d2f);
    border-radius: 16px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.cart-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
}

.cart-item-image {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-secondary, #1d1d1f);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cart-item:hover .cart-item-image img {
    transform: scale(1.05);
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

.cart-item-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin: 0;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.cart-item-price {
    font-size: 15px;
    color: var(--text-secondary, #a1a1a6);
    margin: 0;
    font-weight: 500;
}

/* Quantity Controls */
.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    background: var(--bg-secondary, #1d1d1f);
    color: var(--text-primary, #ffffff);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.quantity-btn:hover {
    background: #0071e3;
    color: white;
    border-color: #0071e3;
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.4);
}

.quantity-btn:active {
    transform: scale(0.96);
}

.quantity-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    min-width: 24px;
    text-align: center;
}

/* Remove Button */
.cart-item-remove {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary, #a1a1a6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
}

.cart-item:hover .cart-item-remove {
    opacity: 1;
}

.cart-item-remove:hover {
    background: #ff3b30;
    color: white;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
}

.cart-item-remove:active {
    transform: scale(0.95) rotate(90deg);
}

/* Cart Footer */
.cart-footer {
    padding: 24px 28px 28px;
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    flex-shrink: 0;
    display: none;
    background: var(--bg-secondary, #1d1d1f);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.cart-subtotal-label {
    font-size: 17px;
    font-weight: 500;
    color: var(--text-primary, #ffffff);
}

.cart-subtotal-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    letter-spacing: -1px;
}

.cart-checkout-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #0071e3 0%, #0077ed 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(0, 113, 227, 0.25), 0 2px 4px rgba(0, 113, 227, 0.15);
    letter-spacing: -0.2px;
}

.cart-checkout-btn:hover {
    background: linear-gradient(135deg, #0077ed 0%, #0084ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 113, 227, 0.35), 0 4px 8px rgba(0, 113, 227, 0.2);
}

.cart-checkout-btn:active {
    transform: translateY(0);
}

.cart-checkout-btn:disabled {
    background: linear-gradient(135deg, #d1d1d6 0%, #c7c7cc 100%);
    color: #8e8e93;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Cart Notification */
.cart-notification {
    position: fixed;
    top: 100px;
    right: 24px;
    background: var(--bg-tertiary, #2d2d2f);
    color: var(--text-primary, #ffffff);
    padding: 18px 28px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    letter-spacing: -0.2px;
}

.cart-notification.show {
    transform: translateX(0);
    opacity: 1;
}

/* Error Notification */
.cart-notification-error {
    background: linear-gradient(135deg, #ff3b30 0%, #ff2d55 100%);
    color: white;
    box-shadow: 0 12px 32px rgba(255, 59, 48, 0.3), 0 4px 8px rgba(255, 59, 48, 0.2);
}

/* Success Notification (default) */
.cart-notification-success {
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
    color: white;
    box-shadow: 0 12px 32px rgba(52, 199, 89, 0.3), 0 4px 8px rgba(52, 199, 89, 0.2);
}

/* Add to Cart Button — shape and sizing fully inherited from .btn-secondary / .btn-buy-link */

/* Dark Mode Support */
[data-theme="dark"] .cart-sidebar {
    background: #1c1c1e;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .cart-header {
    background: linear-gradient(180deg, rgba(28, 28, 30, 1) 0%, rgba(28, 28, 30, 0.98) 100%);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .cart-title {
    color: #f5f5f7;
}

[data-theme="dark"] .cart-close {
    background: rgba(255, 255, 255, 0.08);
    color: #f5f5f7;
}

[data-theme="dark"] .cart-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

[data-theme="dark"] .cart-body {
    background: linear-gradient(180deg, rgba(20, 20, 22, 0) 0%, rgba(20, 20, 22, 0.5) 100%);
}

[data-theme="dark"] .cart-item {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .cart-item:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .cart-item-name {
    color: #f5f5f7;
}

[data-theme="dark"] .cart-item-price {
    color: #98989d;
}

[data-theme="dark"] .cart-item-image {
    background: #3a3a3c;
}

[data-theme="dark"] .quantity-btn {
    background: #3a3a3c;
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}

[data-theme="dark"] .quantity-btn:hover {
    background: #0071e3;
    border-color: #0071e3;
}

[data-theme="dark"] .quantity-value {
    color: #f5f5f7;
}

[data-theme="dark"] .cart-item-remove {
    background: rgba(255, 255, 255, 0.08);
    color: #98989d;
}

[data-theme="dark"] .cart-item-remove:hover {
    background: #ff3b30;
    color: white;
}

[data-theme="dark"] .cart-empty h3 {
    color: #f5f5f7;
}

[data-theme="dark"] .cart-empty p {
    color: #98989d;
}

[data-theme="dark"] .cart-empty-icon {
    opacity: 0.2;
    stroke: #98989d;
}

[data-theme="dark"] .cart-footer {
    background: linear-gradient(180deg, rgba(28, 28, 30, 0.98) 0%, rgba(28, 28, 30, 1) 100%);
    border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .cart-subtotal {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .cart-subtotal-label {
    color: #f5f5f7;
}

[data-theme="dark"] .cart-subtotal-value {
    color: #f5f5f7;
}

[data-theme="dark"] .cart-checkout-btn {
    background: linear-gradient(135deg, #0071e3 0%, #0077ed 100%);
    color: white;
}

[data-theme="dark"] .cart-checkout-btn:hover {
    background: linear-gradient(135deg, #0077ed 0%, #0084ff 100%);
}

[data-theme="dark"] .cart-checkout-btn:disabled {
    background: linear-gradient(135deg, #3a3a3c 0%, #2c2c2e 100%);
    color: #636366;
}

[data-theme="dark"] .cart-notification {
    background: #2c2c2e;
    color: #f5f5f7;
}

/* Light Mode Support */
[data-theme="light"] .cart-sidebar {
    background: #ffffff;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .cart-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.98) 100%);
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .cart-title {
    color: #1d1d1f;
}

[data-theme="light"] .cart-close {
    background: rgba(0, 0, 0, 0.04);
    color: #6e6e73;
}

[data-theme="light"] .cart-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1d1d1f;
}

[data-theme="light"] .cart-body {
    background: linear-gradient(180deg, rgba(250, 250, 250, 0) 0%, rgba(250, 250, 250, 0.5) 100%);
}

[data-theme="light"] .cart-item {
    background: white;
    border-color: rgba(0, 0, 0, 0.04);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .cart-item:hover {
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .cart-item-name {
    color: #1d1d1f;
}

[data-theme="light"] .cart-item-price {
    color: #6e6e73;
}

[data-theme="light"] .cart-item-image {
    background: #f8f8f8;
}

[data-theme="light"] .quantity-btn {
    background: white;
    border-color: rgba(0, 0, 0, 0.1);
    color: #1d1d1f;
}

[data-theme="light"] .quantity-btn:hover {
    background: #0071e3;
    border-color: #0071e3;
    color: white;
}

[data-theme="light"] .quantity-value {
    color: #1d1d1f;
}

[data-theme="light"] .cart-item-remove {
    background: rgba(0, 0, 0, 0.04);
    color: #6e6e73;
}

[data-theme="light"] .cart-item-remove:hover {
    background: #ff3b30;
    color: white;
}

[data-theme="light"] .cart-empty h3 {
    color: #1d1d1f;
}

[data-theme="light"] .cart-empty p {
    color: #6e6e73;
}

[data-theme="light"] .cart-empty-icon {
    opacity: 0.15;
}

[data-theme="light"] .cart-footer {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 1) 100%);
    border-top-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .cart-subtotal {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .cart-subtotal-label {
    color: #1d1d1f;
}

[data-theme="light"] .cart-subtotal-value {
    color: #1d1d1f;
}

[data-theme="light"] .cart-notification {
    background: #1d1d1f;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .cart-sidebar.active {
        right: 0;
    }

    .cart-notification {
        right: 16px;
        left: 16px;
        width: auto;
    }

    .cart-header {
        padding: 24px 20px 20px;
    }

    .cart-body {
        padding: 20px;
    }

    .cart-footer {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .cart-header {
        padding: 20px 16px;
    }

    .cart-body {
        padding: 16px;
    }

    .cart-footer {
        padding: 20px 16px;
    }

    .cart-title {
        font-size: 24px;
    }

    .cart-item {
        padding: 14px;
    }

    .cart-item-image {
        width: 70px;
        height: 70px;
    }

    .cart-item-name {
        font-size: 15px;
    }

    .cart-subtotal-value {
        font-size: 28px;
    }
}

/* Animation for cart items */
@keyframes slideInCart {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item {
    animation: slideInCart 0.3s ease backwards;
}

.cart-item:nth-child(1) { animation-delay: 0.05s; }
.cart-item:nth-child(2) { animation-delay: 0.1s; }
.cart-item:nth-child(3) { animation-delay: 0.15s; }
.cart-item:nth-child(4) { animation-delay: 0.2s; }
.cart-item:nth-child(5) { animation-delay: 0.25s; }

/* ========================================
    USERNAME MODAL - MODERN DESIGN
======================================== */

.username-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: modalFadeIn 0.2s ease;
}

.username-modal.active {
    display: block;
}

.username-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.username-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-primary);
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="light"] .username-modal-content {
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        transform: translate(-50%, -48%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

/* Close Button */
.username-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.username-modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transform: rotate(90deg);
}

html[data-theme="light"] .username-modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Player Avatar Preview */
.minecraft-player-preview {
    text-align: center;
    margin-bottom: 32px;
}

.player-avatar-container {
    position: relative;
    display: inline-block;
    width: 120px;
    height: 120px;
    margin-bottom: 16px;
}

.player-avatar {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(41, 151, 255, 0.1), rgba(118, 75, 162, 0.1));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.player-avatar:hover {
    transform: scale(1.05);
}

.avatar-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-ring {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.player-name {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.02em;
}

/* Modal Header */
.modal-header {
    text-align: center;
    margin-bottom: 28px;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    letter-spacing: -0.03em;
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin: 0;
}

/* Form */
.username-form {
    margin-bottom: 24px;
}

/* Form Steps */
.form-step {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Step Back Button */
.step-back {
    margin-bottom: 20px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

html[data-theme="light"] .btn-back {
    background: rgba(0, 0, 0, 0.03);
}

html[data-theme="light"] .btn-back:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* Discord Info Section */
.discord-info {
    text-align: center;
    margin-bottom: 28px;
}

.discord-icon {
    margin-bottom: 16px;
    opacity: 0.9;
}

.discord-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
}

.discord-info p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin: 0;
}

/* Discord Login Button */
.btn-discord-login {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #5865F2;
    color: white;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
    margin-bottom: 16px;
}

.btn-discord-login:hover {
    background: #4752C4;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(88, 101, 242, 0.4);
}

.btn-discord-login:active {
    transform: translateY(0);
}

.btn-discord-login svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* Discord User Info */
.discord-user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(88, 101, 242, 0.1);
    border: 2px solid rgba(88, 101, 242, 0.2);
    border-radius: 12px;
    margin-bottom: 20px;
}

html[data-theme="light"] .discord-user-info {
    background: rgba(88, 101, 242, 0.05);
}

.discord-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(88, 101, 242, 0.2);
}

.discord-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discord-user-details {
    flex: 1;
    min-width: 0;
}

.discord-username {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.discord-id {
    font-size: 0.875rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-change-discord {
    padding: 8px 16px;
    border: 2px solid rgba(88, 101, 242, 0.3);
    border-radius: 8px;
    background: transparent;
    color: #5865F2;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-change-discord:hover {
    background: rgba(88, 101, 242, 0.1);
    border-color: #5865F2;
}

/* Input Group */
.input-group {
    position: relative;
    margin-bottom: 24px;
}

.input-group input {
    width: 100%;
    padding: 18px 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    font-size: 1.0625rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .input-group input {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.input-group input:hover {
    border-color: rgba(41, 151, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

html[data-theme="light"] .input-group input:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(41, 151, 255, 0.2);
}

.input-group input:focus {
    outline: none;
    border-color: var(--color-accent);
    background: rgba(41, 151, 255, 0.05);
    box-shadow: 0 0 0 4px rgba(41, 151, 255, 0.15), 0 8px 24px rgba(41, 151, 255, 0.2);
    transform: translateY(-1px);
}

html[data-theme="light"] .input-group input:focus {
    background: rgba(41, 151, 255, 0.03);
    box-shadow: 0 0 0 4px rgba(41, 151, 255, 0.1), 0 8px 24px rgba(41, 151, 255, 0.15);
}

.input-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
    font-weight: 400;
}

.input-group label {
    position: absolute;
    top: -11px;
    left: 16px;
    background: var(--bg-primary);
    padding: 2px 10px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-secondary);
    pointer-events: none;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label {
    color: var(--color-accent);
    font-size: 0.75rem;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 18px 28px;
    border: none;
    border-radius: 16px;
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--color-accent), #2a8bdb);
    color: white;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(41, 151, 255, 0.3);
    letter-spacing: 0.02em;
}

.btn-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #3aa3ff, #2a8bdb);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(41, 151, 255, 0.4);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 12px rgba(41, 151, 255, 0.3);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-arrow {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-submit:hover:not(:disabled) .btn-arrow {
    transform: translateX(4px);
}

.btn-submit:hover:not(:disabled) .btn-arrow {
    transform: translateX(4px);
}

.btn-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
}

.spinner {
    animation: rotate 1s linear infinite;
}

.spinner circle {
    stroke: white;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Footer */
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.modal-footer svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .username-modal-content {
        padding: 40px 28px;
        max-width: 90%;
        border-radius: 20px;
    }

    .player-avatar-container {
        width: 100px;
        height: 100px;
    }

    .modal-header h2 {
        font-size: 1.375rem;
    }

    .btn-submit {
        padding: 14px 20px;
    }
}

@media (max-width: 480px) {
    .username-modal-content {
        padding: 32px 24px;
    }

    .player-avatar-container {
        width: 90px;
        height: 90px;
    }
}

