:root {
    --bg: #050816;
    --bg-soft: rgba(15, 23, 42, 0.8);
    --text: #f8fafc;
    --muted: #94a3b8;
    --accent: #f97316;
    --accent-soft: #22d3ee;
    --border: rgba(255,255,255,0.08);
    --glass: rgba(15, 23, 42, 0.6);
    font-family: 'Space Grotesk', system-ui, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Prevent text selection and text cursor on non-editable elements */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: default;
}

/* Allow text selection and text cursor ONLY on input fields and textareas */
input,
textarea,
[contenteditable="true"],
[contenteditable=""] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    cursor: text;
}

/* Pointer cursor for clickable elements */
a,
button,
.btn,
.card[href],
.clickable,
[onclick],
[role="button"],
.nav-links a,
.ranking-name a,
a.card,
.top-player-item,
.shop-item,
.cart-icon-btn,
.cart-item-remove,
.cart-qty-btn,
.ranking-menu-link,
.dropdown-item,
details summary {
    cursor: pointer;
}

body {
    margin: 0;
    background: radial-gradient(circle at top, rgba(14, 43, 88, 0.7), var(--bg));
    color: var(--text);
    min-height: 100vh;
}

a {
    color: var(--accent-soft);
    text-decoration: none;
}

input, button, select {
    font: inherit;
}

.site-shell {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.site-glow {
    position: fixed;
    width: 320px;
    height: 320px;
    filter: blur(160px);
    opacity: 0.4;
    z-index: 0;
}

.site-glow--primary {
    background: var(--accent);
    top: -80px;
    right: -100px;
}

.site-glow--secondary {
    background: var(--accent-soft);
    bottom: -120px;
    left: -80px;
}

.glass {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(2, 6, 23, 0.7);
}

.site-header {
    padding: 1.5rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.5rem;
    position: relative;
    z-index: 2;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text);
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    display: grid;
    place-items: center;
    font-weight: 700;
}

.brand-copy small {
    color: var(--muted);
    display: block;
    font-size: 0.75rem;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
}

.nav-links a.active,
.nav-links a:hover {
    color: var(--text);
}

.nav-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 3;
}

.cart-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    text-decoration: none;
}

.cart-icon-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-1px);
}

.cart-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent);
    color: #0f172a;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.35rem;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.cart-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--glass);
    border: 1px solid var(--border);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(2,6,23,0.5);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.cart-notification.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.nav-actions form {
    display: inline-block;
}

.chip {
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    font-size: 0.9rem;
}

.btn {
    border-radius: 999px;
    padding: 0.5rem 1.4rem;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn.primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    color: #0f172a;
    border: none;
    font-weight: 600;
}

.btn.ghost {
    border-color: var(--border);
}

.btn.soft {
    background: rgba(255,255,255,0.1);
}

.btn:hover {
    opacity: 0.85;
}

.site-main {
    padding: 0 0 4rem;
    position: relative;
    z-index: 1;
}


.section {
    margin: 2rem auto;
    max-width: 1100px;
}

.section.shop-section {
    margin: 1rem auto;
}

.section-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.section-header.shop-header {
    margin-bottom: 1rem;
}

.shop-header .eyebrow {
    font-size: 0.7rem;
    margin-bottom: 0.25rem;
}

.shop-header h2 {
    font-size: 1.75rem;
    margin: 0.25rem 0;
}

.shop-header .lead {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.4em;
    font-size: 0.75rem;
    color: var(--accent-soft);
}

.lead {
    color: var(--muted);
}

.hero {
    padding: 2.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
}

.meta-note {
    color: var(--muted);
}

.card-grid {
    display: grid;
    gap: 1.5rem;
}

.card-grid.stats {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card-grid.feature-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.card {
    padding: 1.5rem;
}

a.card {
    transition: opacity 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

a.card:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

.stat-card h3 {
    margin: 0.5rem 0;
    font-size: 2rem;
}

.label {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
}

.download-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.callout {
    margin-top: 2rem;
    padding: 1.5rem;
}

.auth {
    max-width: 520px;
    margin: 2rem auto;
    padding: 2rem;
    display: grid;
    gap: 1.5rem;
}

.auth-form {
    display: grid;
    gap: 1rem;
}

.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    color: var(--muted);
}

.auth-form input {
    padding: 0.65rem 0.9rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(2,6,23,0.6);
    color: var(--text);
}

.alert {
    padding: 1rem;
    border-radius: 16px;
    margin-bottom: 1rem;
}

.shop-section .alert {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.alert.success { background: rgba(34,197,94,0.15); }
.alert.danger { background: rgba(248,113,113,0.2); }
.alert.warning { background: rgba(251,191,36,0.2); }
.alert.info { background: rgba(59,130,246,0.2); }

/* Shop Styles - Complete Redesign - Compact Version */
.shop-category {
    margin-top: 1.5rem;
}

.shop-category:first-child {
    margin-top: 0;
}

.shop-category-title {
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.7rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    overflow: visible;
}

.shop-item {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.shop-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.5);
    z-index: 5;
}

.shop-item-image {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.shop-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.35rem;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.shop-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.shop-item-name {
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
    min-height: 2em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shop-item-price {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent-soft);
    margin: 0;
}

.shop-item-desc-wrapper {
    position: relative;
    flex: 1;
    min-height: 0;
}

.shop-item-desc {
    font-size: 0.7rem;
    color: var(--text);
    margin: 0;
    line-height: 1.4;
    display: none;
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(5, 8, 22, 0.95);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    width: max-content;
    max-width: 220px;
    min-width: 150px;
    word-wrap: break-word;
    white-space: normal;
    pointer-events: none;
    backdrop-filter: blur(10px);
}

.shop-item-desc::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(5, 8, 22, 0.95);
    z-index: 1;
}

.shop-item-desc::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border);
    z-index: 0;
}

/* Tooltip flipped to bottom */
.shop-item-desc[style*="top"]::before {
    bottom: auto;
    top: -6px;
    border-top-color: transparent;
    border-bottom-color: rgba(5, 8, 22, 0.95);
}

.shop-item-desc[style*="top"]::after {
    bottom: auto;
    top: -7px;
    border-top-color: transparent;
    border-bottom-color: var(--border);
}

.shop-item:hover .shop-item-desc {
    display: block;
}

/* Ensure tooltip doesn't get cut off */
.shop-category {
    overflow: visible;
}

.shop-item-form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: auto;
}

.shop-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.shop-item-quantity label {
    font-size: 0.7rem;
    color: var(--muted);
    white-space: nowrap;
}

.shop-quantity-input {
    width: 50px;
    padding: 0.3rem 0.4rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(2, 6, 23, 0.6);
    color: var(--text);
    font-size: 0.75rem;
    text-align: center;
}

.shop-buy-btn {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.75rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    transition: all 0.2s ease;
}

/* Cart Page Styles */
.cart-section {
    max-width: 900px;
}

.cart-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.cart-items {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    margin-top: 1.5rem;
}

.cart-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-item {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem;
    display: grid;
    grid-template-columns: 80px 1fr auto auto auto;
    gap: 1rem;
    align-items: center;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.5rem;
}

.cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cart-item-details h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.cart-item-price {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(2,6,23,0.6);
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cart-qty-btn:hover {
    background: rgba(255,255,255,0.1);
}

.cart-qty-input {
    width: 60px;
    padding: 0.4rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(2,6,23,0.6);
    color: var(--text);
    text-align: center;
    font-size: 0.9rem;
}

.cart-item-total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-soft);
    min-width: 100px;
    text-align: right;
}

.cart-item-remove {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(248,113,113,0.1);
    color: #f87171;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-remove:hover {
    background: rgba(248,113,113,0.2);
    transform: scale(1.1);
}

.cart-summary {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.cart-total {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--muted);
}

.cart-total-final {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 0.5rem;
}

.cart-checkout-btn {
    width: 100%;
    margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
    .shop-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.6rem;
    }
    
    .shop-item-image {
        height: 70px;
    }
    
    .shop-item-name {
        font-size: 0.75rem;
    }
    
    .shop-item-price {
        font-size: 0.85rem;
    }

    .cart-items {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }

    .cart-item {
        grid-template-columns: 60px 1fr;
        gap: 0.75rem;
    }

    .cart-item-quantity,
    .cart-item-total,
    .cart-item-remove {
        grid-column: 2;
    }

    .cart-item-quantity {
        justify-self: start;
    }

    .cart-item-total {
        justify-self: end;
        text-align: right;
    }

    .cart-item-remove {
        position: absolute;
        top: 1rem;
        right: 1rem;
    }
}

.accordion details {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    background: var(--glass);
}

.accordion summary {
    cursor: pointer;
    font-weight: 600;
}

.site-footer {
    margin: 3rem 1.5rem 1rem;
    padding: 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.footer-grid ul {
    list-style: none;
    padding: 0;
}

.footer-grid li {
    margin: 0.3rem 0;
}

.footer-meta {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.85rem;
}

.nav-toggle {
    display: none;
}

.server-time {
    display: flex;
    align-items: center;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    margin-right: 1rem;
}

.server-time small {
    margin-left: 0.25rem;
    opacity: 0.7;
    font-size: 0.8rem;
}

@media (max-width: 900px) {
    .nav {
        flex-wrap: wrap;
    }
    .nav-links {
        width: 100%;
        flex-direction: column;
        display: none;
    }
    .nav-links.open {
        display: flex;
    }
    .nav-toggle {
        display: inline-flex;
        flex-direction: column;
        gap: 4px;
        background: none;
        border: none;
        margin-left: auto;
    }
    .nav-toggle span {
        width: 24px;
        height: 2px;
        background: var(--text);
    }
    .nav-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    .server-time {
        order: -1;
        width: 100%;
        justify-content: center;
        margin: 0.5rem 0;
        padding: 0.5rem;
        background: rgba(15, 23, 42, 0.4);
        border-radius: 4px;
    }
}

/* Ranking Styles */
.ranking-section {
    max-width: 1200px;
}

.ranking-menu {
    display: flex;
    gap: 0.75rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    align-items: flex-start;
}

.ranking-menu-item {
    position: relative;
}

.ranking-menu-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.ranking-menu-link:hover {
    background: rgba(255,255,255,0.08);
    border-color: var(--accent-soft);
}

.ranking-menu-link.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    color: #0f172a;
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 180px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--accent-soft);
}

.dropdown-item.active {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-soft);
    font-weight: 600;
}

.ranking-title {
    margin: 2rem 0 1.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
}

.ranking-content {
    margin-top: 2.5rem;
}

.ranking-content .alert {
    margin-top: 2rem;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 1rem;
}

.ranking-table thead {
    background: rgba(15, 23, 42, 0.6);
}

.ranking-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    border-bottom: 2px solid var(--border);
    vertical-align: middle;
}

.ranking-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text);
    vertical-align: middle;
}

/* Rank column */
.ranking-table th.col-rank,
.ranking-table td.col-rank {
    padding: 0.875rem 1.5rem;
    text-align: center;
    width: 50px;
}

/* Avatar column */
.ranking-table th.col-avatar,
.ranking-table td.col-avatar {
    padding: 0.875rem 0.5rem;
    text-align: center;
    width: 70px;
}

/* Name column */
.ranking-table th.col-name,
.ranking-table td.col-name {
    padding: 0.875rem 1rem;
    text-align: left;
}

/* Level column */
.ranking-table th.col-level,
.ranking-table td.col-level {
    padding: 0.875rem 1rem;
    text-align: right;
}

/* Class column */
.ranking-table th.col-class,
.ranking-table td.col-class {
    padding: 0.875rem 1rem;
    text-align: left;
}

/* Value columns (CPs, Money, Donation, Arena CPs) */
.ranking-table th.col-value,
.ranking-table td.col-value {
    padding: 0.875rem 1rem;
    text-align: right;
}

/* Title column (Nobility) */
.ranking-table th.col-title,
.ranking-table td.col-title {
    padding: 0.875rem 1rem;
    text-align: left;
}

/* Leader column (Guild) */
.ranking-table th.col-leader,
.ranking-table td.col-leader {
    padding: 0.875rem 1rem;
    text-align: left;
}

/* Members column (Guild) */
.ranking-table th.col-members,
.ranking-table td.col-members {
    padding: 0.875rem 1rem;
    text-align: right;
}

/* Spouse column */
.ranking-table th.col-spouse,
.ranking-table td.col-spouse {
    padding: 0.875rem 1rem;
    text-align: left;
}

/* VIP column */
.ranking-table th.col-vip,
.ranking-table td.col-vip {
    padding: 0.875rem 1.5rem;
    text-align: center;
    width: 60px;
}

.ranking-table tbody tr:last-child td {
    border-bottom: none;
}

.ranking-table tbody tr {
    background: rgba(15, 23, 42, 0.2);
    transition: background 0.2s ease;
}

.ranking-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.3);
}

.ranking-table tbody tr.vip-row {
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.14), rgba(249, 115, 22, 0.1)) !important;
    border-left: 3px solid rgba(34, 211, 238, 0.65);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05),
                0 12px 30px rgba(34, 211, 238, 0.18);
}

.ranking-table tbody tr.vip-row:nth-child(even) {
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.18), rgba(249, 115, 22, 0.14)) !important;
}

.ranking-table tbody tr.vip-row:hover {
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.28), rgba(249, 115, 22, 0.22)) !important;
    border-left-color: var(--accent-soft);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1),
                0 16px 40px rgba(34, 211, 238, 0.25);
}

.ranking-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.15);
}

.ranking-place {
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent-soft);
}

.ranking-avatar {
    text-align: center;
}

.ranking-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    object-fit: cover;
    display: block;
    margin: 0 auto;
}

.ranking-name {
    font-weight: 600;
}

.ranking-name a {
    color: #60a5fa;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}

.ranking-name a:hover {
    color: var(--accent-soft);
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

.ranking-level {
    font-weight: 600;
    color: #fbbf24;
    font-size: 0.95rem;
}

.ranking-value {
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.ranking-class {
    color: var(--text);
    font-weight: 500;
}

.ranking-nobility {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nobility-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.ranking-spouse,
.ranking-vip {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    white-space: nowrap;
    min-width: 100px;
}

.ranking-spouse {
    color: var(--muted);
}

.ranking-vip {
    color: #fbbf24;
    font-weight: 600;
}

@media (max-width: 768px) {
    .ranking-menu {
        flex-direction: column;
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        margin-top: 0.5rem;
        display: none;
    }
    
    .dropdown:hover .dropdown-menu,
    .dropdown.active .dropdown-menu {
        display: block;
    }
    
    .ranking-table {
        font-size: 0.85rem;
    }
    
    .ranking-table th,
    .ranking-table td {
        padding: 0.5rem;
    }
    
    .ranking-avatar img {
        width: 32px;
        height: 32px;
    }
}

/* Home Page Sidebar Styles */
.home-layout {
    display: grid;
    grid-template-columns: 340px 1fr 340px;
    gap: 2rem;
    align-items: start;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.home-sidebar:not(.home-sidebar-right) {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-self: start;
    padding-left: 1.5rem !important;
    margin-left: 0 !important;
}

.home-sidebar.home-sidebar-right {
    padding-left: 0 !important;
    padding-right: 1.5rem !important;
    margin-right: 0 !important;
    display: flex;
    flex-direction: column;
    align-self: start;
    width: 100%;
}

.home-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 0;
}

.home-content .hero {
    max-width: 900px;
    margin: 0 auto;
}

.home-content .section {
    max-width: 1100px;
    margin: 2rem auto;
}

/* Ensure stats cards are side by side - override any stacking */
.home-content .card-grid.stats {
    grid-template-columns: repeat(3, 1fr) !important;
    display: grid !important;
    gap: 1.5rem;
}

/* Ensure feature-grid (Why Sagus) is also 3 columns side by side */
.home-content .card-grid.feature-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    display: grid !important;
    gap: 1rem;
}

@media (max-width: 1200px) {
    .home-content .card-grid.stats {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    }
    
    .home-content .card-grid.feature-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    }
}

/* Online Players Panel - scrollable list */
.online-players-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.online-players-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    min-height: 0;
    padding-right: 0.5rem;
}

/* Custom scrollbar for online players list */
.online-players-list::-webkit-scrollbar {
    width: 6px;
}

.online-players-list::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 3px;
}

.online-players-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.online-players-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 1024px) {
    .home-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .home-sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .home-sidebar-right {
        padding-right: 1.5rem;
    }
    
    .online-players-panel {
        max-height: 600px;
    }
}

.sidebar-panel {
    padding: 1.5rem;
}

.sidebar-panel .label {
    margin-bottom: 1rem;
    display: block;
}

.online-players-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.online-players-header .label {
    margin: 0;
}

.online-players-count {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-soft);
    font-family: 'Courier New', monospace;
}

/* Server Status Panel */
.server-status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.status-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 12px currentColor;
    animation: pulse 2s ease-in-out infinite;
}

.status-online {
    background: #22c55e;
    color: #22c55e;
}

.status-offline {
    background: #ef4444;
    color: #ef4444;
}

.status-online-text {
    color: #22c55e;
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0;
}

.status-offline-text {
    color: #ef4444;
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.player-count {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.count-label {
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.count-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-soft);
    font-family: 'Courier New', monospace;
}

/* Top Players Panel */
.top-players-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.top-player-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.top-player-item:hover {
    background: rgba(15, 23, 42, 0.6);
    border-color: var(--accent-soft);
    transform: translateX(4px);
}

.player-face {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.9);
    flex-shrink: 0;
}

.player-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.player-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.player-class {
    color: var(--accent-soft);
}

.player-level {
    color: #fbbf24;
    font-weight: 600;
    white-space: nowrap;
    margin-left: auto;
}

.no-players {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--muted);
    font-style: italic;
}

@media (max-width: 1024px) {
    .home-sidebar {
        position: static;
        width: 100%;
        left: auto;
        top: auto;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .home-sidebar {
        grid-template-columns: 1fr;
    }
    
    .server-status-indicator {
        margin-bottom: 0.75rem;
    }
    
    .status-online-text,
    .status-offline-text {
        font-size: 1.25rem;
    }
    
    .count-value {
        font-size: 1.5rem;
    }
    
    .top-player-item {
        padding: 0.6rem;
    }
    
    .player-face {
        width: 40px;
        height: 40px;
    }
    
    .player-name {
        font-size: 0.85rem;
    }
    
    .player-details {
        font-size: 0.75rem;
    }
}

