/* Professional Black/White Theme for WebInventory */
:root {
    --transition-props: color, background-color, border-color, box-shadow, transform, opacity, filter, text-decoration-color;
    /* Premium Theme Variables (can be overridden via JS) */
    --theme-primary: #ffffff;
    --theme-secondary: #a3a3a3;
    --theme-accent: #22c55e;
    --theme-background: #000000;
    --theme-card: #0a0a0a;
    --theme-text: #ffffff;

    /* Dark Theme - Pure Black */
    --bg-dark: var(--theme-background, #000000);
    --bg-gradient-start: var(--theme-background, #000000);
    --bg-gradient-end: var(--theme-background, #000000);

    --glass-bg: var(--theme-card, #0a0a0a);
    --glass-border: #262626;
    --glass-highlight: #171717;

    --text-primary: var(--theme-text, #ffffff);
    --text-secondary: var(--theme-secondary, #a3a3a3);
    --text-accent: var(--theme-primary, #ffffff);

    --accent-color: var(--theme-primary, #ffffff);
    --text-on-accent: #000000;
    --accent-glow: rgba(255, 255, 255, 0.2);

    --slot-bg: var(--theme-card, #0a0a0a);
    --slot-border: #262626;
    --slot-inner-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);

    --status-online: var(--theme-accent, #22c55e);
    --status-offline: #ef4444;

    --font-ui: 'Outfit', sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --slot-size: 50px;
    --radius-lg: 8px;
    --radius-md: 6px;
    --radius-sm: 4px;

    --enchant-glow-color: rgba(168, 85, 247, 0.6);

    /* Typography Scale */
    --font-xs: 0.75rem;
    --font-sm: 0.875rem;
    --font-base: 1rem;
    --font-lg: 1.125rem;
    --font-xl: 1.25rem;
    --font-2xl: 1.5rem;
    --font-3xl: 1.875rem;
    --font-4xl: 2.25rem;

    /* Tooltip colors */
    --tooltip-bg: rgba(16, 0, 32, 0.97);
    --tooltip-border: #7c3aed;
    --tooltip-text: white;
}

[data-theme="light"] {
    /* Light Theme - Clean & Modern */
    --bg-dark: #f8fafc;
    --bg-gradient-start: #ffffff;
    --bg-gradient-end: #f1f5f9;

    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(148, 163, 184, 0.4);
    --glass-highlight: rgba(255, 255, 255, 0.95);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-accent: #1e293b;

    --accent-color: #0f172a;
    --text-on-accent: #ffffff;
    --accent-glow: color-mix(in srgb, var(--accent-color) 25%, transparent);

    --slot-bg: rgba(241, 245, 249, 0.9);
    --slot-border: rgba(148, 163, 184, 0.6);
    --slot-inner-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);

    --enchant-glow-color: rgba(139, 92, 246, 0.7);

    --status-online: #22c55e;
    --status-offline: #ef4444;

    /* Light theme tooltips */
    --tooltip-bg: rgba(255, 255, 255, 0.97);
    --tooltip-border: #6366f1;
    --tooltip-text: #0f172a;
}

[data-theme="dark"] {
    --bg-dark: var(--theme-background, #000000);
    --bg-gradient-start: var(--theme-background, #000000);
    --bg-gradient-end: var(--theme-background, #000000);

    --glass-bg: var(--theme-card, #0a0a0a);
    --glass-border: #262626;
    --glass-highlight: #171717;

    --text-primary: var(--theme-text, #ffffff);
    --text-secondary: var(--theme-secondary, #a3a3a3);
    --text-accent: var(--theme-primary, #ffffff);

    --accent-color: var(--theme-primary, #ffffff);
    --text-on-accent: #000000;
    --accent-glow: rgba(255, 255, 255, 0.2);

    --slot-bg: var(--theme-card, #0a0a0a);
    --slot-border: #262626;
    --slot-inner-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);

    --enchant-glow-color: rgba(168, 85, 247, 0.6);

    --status-online: var(--theme-accent, #22c55e);
    --status-offline: #ef4444;

    --tooltip-bg: rgba(16, 0, 32, 0.97);
    --tooltip-border: #7c3aed;
    --tooltip-text: white;
}

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

body {
    font-family: var(--font-ui);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    /* App handles scrolling */
    /* App handles scrolling */
    height: 100vh;
}

.hidden {
    display: none !important;
}

/* Smooth feedback on things people touch (not on every element: inventory re-renders stay cheap) */
a,
button,
input,
select,
textarea,
.slot {
    transition-property: background-color, border-color, color, opacity, transform, box-shadow;
    transition-duration: 0.2s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.app {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Header */
.header {
    padding: 1rem 2rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 2rem;
    z-index: 50;
    transition-property: var(--transition-props);
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

.header-controls {
    margin-left: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

/* Header Balance Display */
.store-balance-header {
    background: var(--accent-color);
    color: var(--bg-dark);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Small Secondary Button */
.btn-secondary-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-ui);
    font-weight: 500;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

.btn-secondary-small:hover {
    background: var(--glass-highlight);
    border-color: var(--accent-color);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem 0.25rem 0.25rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    cursor: pointer;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

.header-user:hover {
    background: var(--glass-highlight);
    border-color: var(--accent-color);
}

.header-user img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.header-user span {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Search */
.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Header Navigation Tabs */
.header-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 2rem;
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-ui);
    cursor: pointer;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: var(--glass-highlight);
}

.nav-tab.active {
    color: var(--text-primary);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.nav-tab i {
    font-size: 1rem;
}

.search-container {
    position: relative;
    display: flex;
    gap: 0.5rem;
}

.search-input {
    background: var(--slot-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    width: 280px;
    font-family: var(--font-ui);
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

.search-input:focus-visible {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 25%, transparent);
}

.search-btn {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--text-primary);
    padding: 0 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

/* Search Button Large */
.search-btn-large {
    background: var(--accent-color);
    color: var(--text-on-accent);
    border: none;
    padding: 0 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-family: var(--font-ui);
    cursor: pointer;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
    font-size: 1rem;
}

.search-btn-large:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.search-input-large {
    background: var(--slot-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    width: 320px;
    font-family: var(--font-ui);
    font-size: 1.1rem;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

.search-input-large:focus-visible {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-color) 25%, transparent);
    background: var(--glass-highlight);
}

.landing-search {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1rem;
    position: relative;
}

.search-btn:hover {
    background: var(--text-primary);
    color: var(--bg-dark);
}

/* Button Styles - Enhanced with glow effects */
.btn-primary {
    background: var(--accent-color);
    color: var(--text-on-accent);
    border: none;
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-family: var(--font-ui);
    cursor: pointer;
    transition-property: var(--transition-props);
    transition-duration: 0.25s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-3px) scale(1.02);
}

.btn-primary:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-secondary {
    background: var(--slot-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-family: var(--font-ui);
    cursor: pointer;
    transition-property: var(--transition-props);
    transition-duration: 0.25s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover {
    background: var(--glass-highlight);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.btn-icon {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
    font-size: 1.25rem;
}

.btn-icon:hover {
    background: var(--slot-bg);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.back-btn {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-family: var(--font-ui);
    cursor: pointer;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
    margin-top: 1rem;
}

.back-btn:hover {
    background: var(--slot-bg);
    border-color: var(--accent-color);
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    /* Full width of search container */
    background-color: var(--bg-dark);
    /* Solid bg for readability */
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-top: 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.15s;
    border-bottom: 1px solid var(--glass-border);
}

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

.autocomplete-item:hover {
    background-color: var(--glass-highlight);
}

.autocomplete-item img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

/* Theme Toggle */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

.theme-toggle:hover {
    background: var(--glass-highlight);
    transform: rotate(15deg);
}

/* Header Tab (Store, etc.) */
.header-tab {
    background: var(--slot-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-ui);
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
    margin-right: 0.5rem;
}

.header-tab i {
    font-size: 1rem;
    color: var(--accent-color);
}

.header-tab:hover {
    background: var(--glass-highlight);
    border-color: var(--accent-color);
}

/* Premium Link - Golden accent */
.premium-link {
    text-decoration: none;
    background: #fbbf24;
    border-color: #f59e0b;
    color: #000 !important;
}

.premium-link i {
    color: #000 !important;
}

.premium-link:hover {
    background: #fcd34d;
    border-color: #fbbf24;
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.state-container {
    width: 100%;
    max-width: 1100px;
    /* Slightly wider */
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-state {
    text-align: center;
    padding: 5rem 2rem;
}

/* Inventory State - Player View */
.inventory-state {
    padding: 2rem;
}

.inventory-state .player-header {
    margin-bottom: 2rem;
}

.inventory-state .main-nav {
    margin-bottom: 1.5rem;
}

.inventory-state .potion-effects-section {
    margin-bottom: 1.5rem;
}

.landing-state h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
    animation: fadeInUp 0.6s ease-out;
    color: var(--text-primary);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-state p {
    color: var(--text-secondary);
    font-size: 1.15rem;
    max-width: 650px;
    margin: 0 auto 2rem;
    line-height: 1.7;
    animation: fadeInUp 0.6s ease-out 0.1s backwards;
}

/* Favorites Section */
.favorites-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

.favorites-section h3,
.online-players-section h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.favorites-grid,
.online-players {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

/* Player/Favorites Chips - Enhanced with scale and glow */
.player-chip,
.favorite-chip {
    background: var(--slot-bg);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition-property: var(--transition-props);
    transition-duration: 0.25s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

.player-chip::before,

.player-chip:hover::before,
.favorite-chip:hover::before {
    transform: translateX(100%);
}

.player-chip:hover,
.favorite-chip:hover {
    background: var(--glass-highlight);
    border-color: var(--accent-color);
    transform: translateY(-3px) scale(1.02);
}

.player-chip img,
.favorite-chip img {
    border-radius: 8px;
    width: 28px;
    height: 28px;
    transition: transform 0.2s;
}

.player-chip:hover img,
.favorite-chip:hover img {
    transform: scale(1.1);
}

/* Network mode: the server a player is on */
.player-server {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 6px;
    background: var(--glass-highlight);
    color: var(--text-secondary);
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Remove Favorite Button */
.remove-favorite {
    margin-left: 0.25rem;
    color: var(--text-secondary);
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.remove-favorite:hover {
    color: var(--status-offline);
}

/* Loading & Error */
.loading-state,
.error-state {
    text-align: center;
    padding: 6rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    border: 4px solid var(--glass-border);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.back-btn {
    margin-top: 2rem;
    padding: 0.75rem 2rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

.back-btn:hover {
    background: var(--glass-highlight);
    border-color: var(--text-primary);
}

/* View Tabs */
.view-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-family: var(--font-ui);
    cursor: pointer;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--glass-highlight);
}

.tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background: var(--glass-highlight);
}

.action-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
    margin-left: auto;
}

.action-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Close Button (player site and admin panel share it) */
.close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

.close-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.06));
    border-color: var(--glass-border, transparent);
}

.close-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.close-btn i {
    font-size: 1.25rem;
}

/* Footer */
.footer {
    padding: 1.25rem 2rem;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    background: var(--glass-bg);
    margin-top: auto;
}

.branding-footer {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

.branding-footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

.branding-footer a:hover {
    text-decoration: underline;
    filter: brightness(1.2);
}

/* Inventory View Header */
.player-header {
    display: flex;
    gap: 3rem;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

.player-info {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: center;
}

.player-model-wrapper {
    width: 100px;
    height: 150px;
    background: var(--slot-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.player-details h2 {
    font-size: 2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    line-height: 1.2;
}

/* LuckPerms Prefix/Rank Badge */
.player-rank {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--accent-color);
    color: var(--bg-dark);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
}

.discord-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #5865F2;
    /* Discord blurple */
    margin-left: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.discord-avatar:hover {
    transform: scale(1.1);
}

.favorite-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
    margin-left: 0.5rem;
}

.favorite-btn:hover,
.favorite-btn.active {
    color: #fbbf24;
    transform: scale(1.1);
}

.player-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

/* Status Bars */

/* Heart Icons */

/* Food/Hunger Icons */

/* Armor Icons */

/* Player Bars Container */

/* Player Stats: level with its XP bar, then the game mode */

/* The game's own experience green */

/* Main Navigation */

/* Inventory Container Layout - Horizontal with sidebar */

/* Equipment Sidebar - Armor + Offhand stacked vertically */

/* Main Inventory Area - Inventory + Hotbar stacked */

/* Armor Grid - 1 column (vertical stack) */

/* Offhand - single slot */

/* Main Inventory Grid - 9x3 */

/* Hotbar Grid - 9 horizontal slots */

/* Ender Chest Grid - 9x3 */

/* ============================================
   Statistics View
   ============================================ */

/* ============================================
   Advancements View
   ============================================ */

/* Slot Item Wrapper */

/* Item Amount/Count */

/* Durability Bar */

/* Enchanted Glow */

/* Item Fallback Text */

/* Item Tooltip */

/* Skills Grid (mcMMO) */

/* Map Frame */

/* Store Styles */

/* Not linked yet: one strip above the items (people browse first, link to buy) */

/* ========================================
   Store Item Modal - Premium Redesign
   ======================================== */

/* Item Preview - Enhanced */

/* Price Grid - Enhanced */

/* Stock Row - Enhanced */

/* Item Lore - Enhanced */

/* Quantity Picker - Enhanced */

/* Total Price Row - Enhanced */

/* Action Buttons - Enhanced */

/* Transaction Result - Enhanced */

/* ========================================
   Ranks Section - Premium Design
   ======================================== */

/* Light theme ranks */

/* Modals */

/* Responsive */

/* ========================================
   Ticket System Styles
   ======================================== */

/* Ticket counters: one divided panel, label over value; the status colour is a dot, not a stripe */
.ticket-stats {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    margin-bottom: 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

.ticket-stat {
    display: flex;
    flex-direction: column-reverse; /* label above the value */
    align-items: flex-start;
    gap: 0.3rem;
    padding: 1rem 1.25rem;
    border-left: 1px solid var(--glass-border);
}

.ticket-stat:first-child { border-left: 0; }

.ticket-stat-value {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.ticket-stat-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.ticket-stat.open .ticket-stat-label::before,
.ticket-stat.progress .ticket-stat-label::before,
.ticket-stat.resolved .ticket-stat-label::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
}
.ticket-stat.progress .ticket-stat-label::before { background: #3b82f6; }
.ticket-stat.resolved .ticket-stat-label::before { background: #10b981; }

@media (max-width: 640px) {
    .ticket-stats { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ticket-stat:nth-child(odd) { border-left: 0; }
    .ticket-stat:nth-child(n + 3) { border-top: 1px solid var(--glass-border); }
}

.status-badge {
    padding: 0.3rem 0.85rem;
    border-radius: 50px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.status-badge::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status-badge.online {
    background: rgba(34, 197, 94, 0.15);
    color: var(--status-online);
}

.status-badge.online::before {
    animation: pulse-online 2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
}

@keyframes pulse-online {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }
}

.status-badge.offline {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-offline);
}

.last-updated {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Status Bars */
.player-bars {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.bar-row {
    display: flex;
    gap: 1px;
}

.bar-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: opacity 0.2s;
}

/* Heart Icons */
.bar-icon.icon-heart::before {
    content: '❤';
}

.bar-icon.icon-heart.full {
    color: #e74c3c;
    text-shadow: 0 0 4px rgba(231, 76, 60, 0.5);
}

.bar-icon.icon-heart.half {
    color: #e74c3c;
    opacity: 0.6;
}

.bar-icon.icon-heart.empty {
    color: #333;
    opacity: 0.3;
}

/* Food/Hunger Icons */
.bar-icon.icon-food::before {
    content: '🍖';
}

.bar-icon.icon-food.full {
    opacity: 1;
}

.bar-icon.icon-food.half {
    opacity: 0.6;
}

.bar-icon.icon-food.empty {
    filter: grayscale(1);
    opacity: 0.3;
}

/* Armor Icons */
.bar-icon.icon-armor::before {
    content: '🛡';
}

.bar-icon.icon-armor.full {
    opacity: 1;
}

.bar-icon.icon-armor.half {
    opacity: 0.6;
}

.bar-icon.icon-armor.empty {
    filter: grayscale(1);
    opacity: 0.2;
}

/* Player Bars Container */
.player-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 0.5rem;
}

/* Player Stats: level with its XP bar, then the game mode */
.player-stats {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.6rem;
    min-width: 210px;
    padding-left: 2rem;
    border-left: 1px solid var(--glass-border);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
}

.stat-item .stat-icon {
    font-size: 1.15rem;
    color: var(--text-secondary);
}

.stat-level .stat-icon { color: #f5c542; }
.stat-level strong { font-variant-numeric: tabular-nums; }

.xp-text {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

/* The game's own experience green */
.xp-bar-container {
    height: 6px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--text-primary) 12%, transparent);
    overflow: hidden;
    margin: -0.2rem 0 0.35rem;
}

.xp-bar {
    height: 100%;
    background: #7ec628;
    border-radius: inherit;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Main Navigation */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-bottom: 3px solid transparent;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    cursor: pointer;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
    font-family: var(--font-ui);
}

.nav-btn:hover {
    color: var(--text-primary);
}

.nav-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background: color-mix(in srgb, var(--accent-color) 10%, transparent);
}

/* Inventory Container Layout - Horizontal with sidebar */
.inventory-container {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* Equipment Sidebar - Armor + Offhand stacked vertically */
.equipment-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

/* Main Inventory Area - Inventory + Hotbar stacked */
.main-inventory-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.inventory-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.inventory-section h3 {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 700;
    margin: 0;
    text-align: center;
}

/* Armor Grid - 1 column (vertical stack) */
.armor-grid {
    display: grid;
    grid-template-columns: var(--slot-size);
    gap: 4px;
    padding: 0.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}

/* Offhand - single slot */
.offhand-slot {
    display: flex;
    padding: 0.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}

/* Main Inventory Grid - 9x3 */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(9, var(--slot-size));
    gap: 4px;
    padding: 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}

/* Hotbar Grid - 9 horizontal slots */
.hotbar-grid {
    display: grid;
    grid-template-columns: repeat(9, var(--slot-size));
    gap: 4px;
    padding: 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}

/* Ender Chest Grid - 9x3 */
.enderchest-grid {
    display: grid;
    grid-template-columns: repeat(9, var(--slot-size));
    gap: 4px;
    padding: 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
}

/* ============================================
   Statistics View
   ============================================ */
.stats-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

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

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-color);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* ============================================
   Advancements View
   ============================================ */
.advancements-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

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

.advancement-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    transition: transform 0.2s, border-color 0.2s;
}

.advancement-card:hover {
    transform: translateY(-2px);
}

.advancement-card.completed {
    border-color: var(--status-online);
    background: rgba(34, 197, 94, 0.05);
}

.advancement-card.completed:hover {
    border-color: var(--status-online);
}

.advancement-card.locked {
    opacity: 0.6;
}

.advancement-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.advancement-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.advancement-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.advancement-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.slot {
    width: var(--slot-size);
    height: var(--slot-size);
    background-color: var(--slot-bg);
    border: 2px solid var(--slot-border);
    position: relative;
    cursor: pointer;
    transition-property: var(--transition-props);
    transition-duration: 0.1s;
    transition-timing-function: ease;
    image-rendering: pixelated;
    border-radius: 4px;
    box-shadow: var(--slot-inner-shadow);
}

.slot:hover {
    background-color: var(--glass-highlight);
    border-color: var(--accent-color);
    transform: scale(1.05);
    z-index: 10;
}

.slot img {
    width: 65%;
    height: 65%;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.slot .count {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 0 #000;
    pointer-events: none;
}

.slot.enchanted {
    box-shadow: inset 0 0 8px var(--enchant-glow-color);
    border-color: #a855f7 !important;
}

.slot.empty {
    opacity: 0.5;
    cursor: default;
}

.slot.empty:hover {
    transform: none;
    background-color: var(--slot-bg);
    border-color: var(--slot-border);
}

/* Slot Item Wrapper */
.slot-item {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slot-item img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    image-rendering: pixelated;
}

.slot-item.enchanted {
    animation: enchant-shimmer 2s ease-in-out infinite;
}

@keyframes enchant-shimmer {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.3) hue-rotate(10deg);
    }
}

/* Item Amount/Count */
.item-amount {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-variant-numeric: tabular-nums;
    font-size: 11px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000;
    pointer-events: none;
    z-index: 2;
}

/* Durability Bar */
.durability-bar {
    position: absolute;
    bottom: 3px;
    left: 3px;
    right: 3px;
    height: 3px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 1px;
    overflow: hidden;
}

.durability-fill {
    height: 100%;
    border-radius: 1px;
    transition: width 0.3s ease;
}

.durability-fill.high {
    background: #22c55e;
}

.durability-fill.medium {
    background: #f59e0b;
}

.durability-fill.low {
    background: #ef4444;
}

/* Enchanted Glow */
.enchanted-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(168, 85, 247, 0.1) 0%,
            rgba(168, 85, 247, 0.2) 50%,
            rgba(168, 85, 247, 0.1) 100%);
    pointer-events: none;
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* Item Fallback Text */
.item-fallback-text {
    font-size: 10px;
    font-weight: bold;
    color: var(--text-secondary);
    text-align: center;
}

/* Item Tooltip */
.item-tooltip,
#itemTooltip {
    position: fixed;
    background: var(--tooltip-bg);
    border: 2px solid var(--tooltip-border);
    border-radius: 6px;
    padding: 12px 14px;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    min-width: 180px;
    max-width: 320px;
    color: var(--tooltip-text);
    font-family: var(--font-ui);
}

.item-tooltip.hidden {
    display: none;
}

.tooltip-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 6px;
    color: #fff;
}

.tooltip-name.enchanted {
    color: #a78bfa;
    text-shadow: 0 0 8px rgba(167, 139, 250, 0.5);
}

.tooltip-lore {
    color: #a78bfa;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 8px;
    font-style: italic;
}

.tooltip-lore div {
    margin-bottom: 2px;
}

.tooltip-enchants {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(124, 58, 237, 0.3);
}

.tooltip-enchants .enchant {
    color: #60a5fa;
    font-size: 0.85rem;
    margin-bottom: 3px;
}

.tooltip-durability {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(124, 58, 237, 0.3);
    font-size: 0.8rem;
    color: #9ca3af;
    font-variant-numeric: tabular-nums;
}

/* Skills Grid (mcMMO) */
.skills-container-inner {
    max-width: 900px;
    margin: 0 auto;
}

.skills-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.power-level {
    font-weight: 700;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.skill-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s;
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.skill-icon-wrapper {
    background: var(--slot-bg);
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
}

.skill-icon-wrapper img {
    width: 32px;
    height: 32px;
    image-rendering: auto;
}

.skill-details {
    flex: 1;
}

.skill-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.skill-level {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.skill-progress-bg {
    height: 6px;
    background: var(--glass-border);
    border-radius: 3px;
    overflow: hidden;
}

.skill-progress-fill {
    height: 100%;
    background: var(--accent-color);
    border-radius: 3px;
    width: 0;
    transition: width 1s ease-out;
}

.badgem {
    padding: 0.4rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid currentColor;
}

.badge-primary {
    color: var(--accent-color);
    background: rgba(34, 197, 94, 0.1);
}

/* Map Frame */
.map-state {
    padding: 0 !important;
    max-width: 100% !important;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.map-frame {
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 140px);
    /* Full height minus header (~70px) and footer (~70px) */
    border: none;
    border-radius: 0;
    background: var(--bg-dark);
}

/* Store Styles */
.store-container {
    width: 100%;
}

.store-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.store-balance-box {
    background: var(--glass-bg);
    border: 1px solid var(--accent-color);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--accent-color);
}

.store-balance-box i {
    font-size: 1.25rem;
}

/* Not linked yet: one strip above the items (people browse first, link to buy) */
.store-link-view-center {
    margin-bottom: 1.5rem;
}

.store-link-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
}

.store-link-icon {
    font-size: 1.75rem;
    color: var(--text-secondary);
    grid-row: span 2;
}

.store-link-content h3 {
    font-size: 1rem;
    margin: 0;
}

.store-link-content > p {
    grid-column: 2;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.15rem 0 0;
}

#generateLinkCodeBtn {
    grid-column: 3;
    grid-row: 1 / span 2;
    white-space: nowrap;
}

.store-link-content .link-code-display {
    grid-column: 1 / -1;
    text-align: center;
}

@media (max-width: 640px) {
    .store-link-content { grid-template-columns: auto 1fr; row-gap: 0.75rem; }
    #generateLinkCodeBtn { grid-column: 1 / -1; grid-row: auto; width: 100%; }
}

.link-code-display {
    margin-top: 1.5rem;
    background: var(--slot-bg);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px dashed var(--glass-border);
}

.link-code {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    color: var(--accent-color);
    margin: 0.5rem 0;
    font-weight: 700;
}

.store-categories-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.store-category-chip {
    /* Solid pill style for better visibility */
    background: var(--slot-bg);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1.75rem;
    border-radius: 100px;
    white-space: nowrap;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
}

.store-category-chip:hover {
    background: var(--glass-highlight);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.store-category-chip.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--text-on-accent);
    transform: scale(1.05);
}

.store-category-chip img {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
    object-fit: contain;
}

.store-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.store-item-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    text-align: center;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
    position: relative;
    overflow: hidden;
}

.store-item-card:hover {
    transform: translateY(-2px);
    border-color: var(--text-secondary);
}

.store-item-card img {
    display: block;
    margin: 0 auto 0.75rem;
    image-rendering: pixelated;
}

.store-item-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 1rem;
    image-rendering: pixelated;
}

.store-item-name {
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.store-item-price {
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    margin-top: 0.25rem;
}

/* ========================================
   Store Item Modal - Premium Redesign
   ======================================== */

.store-item-modal {
    max-width: 440px;
    padding: 0;
    overflow: hidden;
}

.store-item-modal .modal-header {
    background: transparent;
    border-bottom: 1px solid var(--glass-border);
    padding: 1.25rem 1.5rem;
}

.store-item-modal .modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.store-item-modal .modal-body {
    padding: 1.5rem;
}

/* Item Preview - Enhanced */
.store-item-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2.5rem;
    background: var(--slot-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.store-item-preview img {
    width: 96px;
    height: 96px;
    image-rendering: pixelated;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.store-item-preview:hover img {
    transform: scale(1.1) rotate(-3deg);
}

/* Price Grid - Enhanced */
.store-price-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.price-box {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem 0.75rem;
    text-align: center;
    transition-property: var(--transition-props);
    transition-duration: 0.25s;
    transition-timing-function: ease;
    position: relative;
    overflow: hidden;
}

.price-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--glass-border);
    transition: background 0.25s ease;
}

.price-box .label {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.price-box .value {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.price-box.buy {
    border-color: var(--glass-border);
    background: var(--glass-bg);
}

.price-box.buy::before {
    background: var(--accent-color);
}

.price-box.buy .value {
    color: var(--text-primary);
}

.price-box.buy:hover {
    border-color: var(--text-secondary);
    transform: translateY(-2px);
}

.price-box.sell {
    border-color: var(--glass-border);
    background: var(--glass-bg);
}

.price-box.sell::before {
    background: var(--status-online);
}

.price-box.sell .value {
    color: var(--status-online);
}

.price-box.sell:hover {
    border-color: var(--status-online);
    transform: translateY(-2px);
}

/* Stock Row - Enhanced */
.store-stock-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.store-stock-row .label {
    color: var(--text-secondary);
    font-weight: 500;
}

.store-stock-row .value {
    font-weight: 700;
    color: var(--text-primary);
}

/* Item Lore - Enhanced */
.store-item-lore {
    background: var(--slot-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: #c4b5fd;
    font-style: italic;
    line-height: 1.6;
}

.store-item-lore.hidden {
    display: none;
}

/* Quantity Picker - Enhanced */
.quantity-picker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin: 1.5rem 0;
    padding: 0.5rem;
}

.qty-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    border-color: var(--accent-color);
    background: var(--accent-color);
    color: white;
    transform: scale(1.08);
}

.qty-btn:active {
    transform: scale(0.95);
}

.qty-value {
    font-size: 2.25rem;
    font-weight: 800;
    min-width: 80px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

/* Total Price Row - Enhanced */
.total-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: var(--glass-highlight);
    border: 2px solid color-mix(in srgb, var(--accent-color) 40%, transparent);
    border-radius: 14px;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.total-price-row .label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-secondary);
}

.total-price-row .value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Action Buttons - Enhanced */
.store-item-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-buy,
.btn-sell {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition-property: var(--transition-props);
    transition-duration: 0.25s;
    transition-timing-function: ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    background: transparent;
}

.btn-buy::before,

.btn-buy {
    background: var(--accent-color);
    color: var(--text-on-accent);
    border-color: transparent;
}

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

.btn-buy:active {
    transform: translateY(-1px);
}

.btn-sell {
    background: transparent;
    border-color: #22c55e;
    color: #4ade80;
}

.btn-sell:hover {
    background: var(--status-online);
    color: white;
    transform: translateY(-3px);
}

.btn-sell:active {
    transform: translateY(-1px);
}

.btn-buy:disabled,
.btn-sell:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Transaction Result - Enhanced */
.transaction-result {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.transaction-result.success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: #4ade80;
}

.transaction-result.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #f87171;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ========================================
   Ranks Section - Premium Design
   ======================================== */
.ranks-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.ranks-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.ranks-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.ranks-header h3 i {
    color: #fbbf24;
}

.ranks-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.ranks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.rank-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition-property: var(--transition-props);
    transition-duration: 0.3s;
    transition-timing-function: ease;
    position: relative;
    overflow: hidden;
}

.rank-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #f59e0b;
}

.rank-card:hover {
    transform: translateY(-4px);
    border-color: rgba(251, 191, 36, 0.4);
}

.rank-card.owned {
    border-color: rgba(34, 197, 94, 0.4);
}

.rank-card.owned::before {
    background: var(--status-online);
}

.rank-icon {
    width: 64px;
    height: 64px;
    background: rgba(251, 191, 36, 0.12);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.rank-icon img {
    width: 40px;
    height: 40px;
    image-rendering: pixelated;
    object-fit: contain;
}

.rank-info {
    flex: 1;
}

.rank-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.rank-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.rank-badge {
    display: inline-block;
    font-size: 0.8125rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
    margin-top: 0.5rem;
}

.rank-badge.permanent {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.rank-badge.duration {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
    border: 1px solid color-mix(in srgb, var(--accent-color) 30%, transparent);
}

.rank-price {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.price-ingame {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fbbf24;
    font-variant-numeric: tabular-nums;
}

.price-real {
    font-size: 1.1rem;
    font-weight: 700;
    color: #22c55e;
    font-variant-numeric: tabular-nums;
}

.rank-actions {
    margin-top: auto;
}

.btn-buy-rank {
    width: 100%;
    padding: 0.85rem 1.25rem;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    background: #f59e0b;
    color: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition-property: var(--transition-props);
    transition-duration: 0.25s;
    transition-timing-function: ease;
}

.btn-buy-rank:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn-buy-rank:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-owned {
    width: 100%;
    padding: 0.85rem 1.25rem;
    border: 2px solid rgba(34, 197, 94, 0.4);
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: default;
}

/* Light theme ranks */
[data-theme="light"] .rank-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(148, 163, 184, 0.3);
}

[data-theme="light"] .rank-icon {
    background: rgba(251, 191, 36, 0.12);
}

[data-theme="light"] .price-ingame {
    color: #d97706;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: scale(1);
    transition: transform 0.3s;
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.9);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.buy-modal-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    text-align: center;
}

.buy-modal-item img {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    image-rendering: pixelated;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-primary);
    cursor: pointer;
}

.qty-display {
    font-size: 1.25rem;
    font-weight: 700;
    width: 40px;
    text-align: center;
}

.total-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-actions button {
    flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .inventory-grid {
        grid-template-columns: repeat(9, var(--slot-size));
        padding: 0.5rem;
        gap: 4px;
        width: 100%;
        overflow-x: auto;
    }

    .slot {
        width: 36px;
        height: 36px;
    }

    .player-header {
        flex-direction: column;
        gap: 1.5rem;
    }

    .player-stats {
        border-left: none;
        padding-left: 0;
        width: 100%;
        border-top: 1px solid var(--glass-border);
        padding-top: 1.5rem;
    }

    .search-input {
        width: 100%;
    }

    .header-nav {
        margin-left: 0;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
}

.payment-methods {
    margin-top: 1.5rem;
    width: 100%;
}

.payment-divider {
    display: flex;
    align-items: center;
    margin: 1rem 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.payment-divider::before,
.payment-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
    margin: 0 1rem;
}

.payment-buttons {
    display: flex;
    gap: 1rem;
}

.btn-paypal {
    flex: 1;
    background: #0070ba;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: filter 0.2s;
}

.btn-paypal:hover {
    filter: brightness(1.1);
}

.btn-crypto {
    flex: 1;
    background: #111;
    color: white;
    border: 1px solid #333;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-crypto:hover {
    background: #222;
}

.btn-paypal svg,
.btn-crypto svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.real-money-price {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.real-money-price strong {
    color: var(--accent-color);
    font-size: 1.1rem;
}

/* ========================================
   Ticket System Styles
   ======================================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.status-open {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-badge.status-in_progress {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.status-badge.status-resolved {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.status-closed {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.2);
}

.priority-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.priority-badge.priority-low {
    background: rgba(107, 114, 128, 0.1);
    color: #9ca3af;
}

.priority-badge.priority-normal {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.priority-badge.priority-high {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.priority-badge.priority-urgent {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

/* Ticket Modal */
.modal-lg {
    max-width: 800px;
}

.ticket-info {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.ticket-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ========================================
   Ticket Messages - Premium Chat Design
   ======================================== */
.ticket-messages {
    max-height: 450px;
    min-height: 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--slot-bg);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--glass-border);
    scroll-behavior: smooth;
}

.ticket-messages::-webkit-scrollbar {
    width: 6px;
}

.ticket-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ticket-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.ticket-message {
    padding: 1rem 1.25rem;
    border-radius: 18px;
    max-width: 85%;
    position: relative;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Player Message - Left Side */
.ticket-message.player {
    background: var(--glass-highlight);
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ticket-message.player::before {
    content: '';
    position: absolute;
    left: -8px;
    bottom: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 8px 12px 0;
    border-color: transparent rgba(255, 255, 255, 0.08) transparent transparent;
}

/* Admin Message - Right Side */
.ticket-message.admin {
    align-self: flex-end;
    border-bottom-right-radius: 6px;
    background: var(--accent-color);
    color: white;
    border: none;
}

.ticket-message.admin::before {
    content: '';
    position: absolute;
    right: -8px;
    bottom: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 12px 8px 0 0;
    border-color: var(--accent-color) transparent transparent transparent;
}

/* Message Header - Sender & Time */
.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.ticket-message.player .message-header {
    color: var(--text-secondary);
}

.ticket-message.admin .message-header {
    color: rgba(255, 255, 255, 0.85);
}

.message-header .sender {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-header .sender::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.ticket-message.player .message-header .sender::before {
    background: var(--text-secondary);
}

.ticket-message.admin .message-header .sender::before {
    background: #4ade80;
}

.message-header .timestamp {
    font-size: 0.68rem;
    opacity: 0.8;
}

/* Message Content */
.message-content {
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.ticket-message.player .message-content {
    color: var(--text-primary);
}

.ticket-message.admin .message-content {
    color: white;
}

/* Ticket Reply Input Area */
.ticket-reply {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    padding: 1.25rem;
    background: var(--glass-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    margin-top: 1rem;
}

.ticket-reply textarea {
    flex: 1;
    resize: vertical;
    min-height: 80px;
    padding: 1rem 1.25rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--slot-bg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

.ticket-reply textarea::placeholder {
    color: var(--text-secondary);
}

.ticket-reply textarea:focus-visible {
    background: var(--glass-highlight);
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 25%, transparent);
}

.ticket-reply button {
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 52px;
}

/* ============================================
   Light Theme Specific Overrides
   ============================================ */
[data-theme="light"] .glass-card,
[data-theme="light"] .inventory-grid,
[data-theme="light"] .hotbar-grid,
[data-theme="light"] .armor-grid,
[data-theme="light"] .enderchest-grid,
[data-theme="light"] .offhand-slot {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .slot {
    background-color: rgba(241, 245, 249, 0.95);
    border-color: rgba(148, 163, 184, 0.6);
}

[data-theme="light"] .slot:hover {
    background-color: rgba(224, 231, 255, 0.8);
    border-color: var(--accent-color);
}

[data-theme="light"] .header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .stat-card,
[data-theme="light"] .advancement-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .player-header {
    border-bottom-color: rgba(148, 163, 184, 0.3);
}

[data-theme="light"] .player-model-wrapper {
    background: rgba(241, 245, 249, 0.9);
    border-color: rgba(148, 163, 184, 0.5);
}

[data-theme="light"] .main-nav .nav-btn {
    color: var(--text-secondary);
}

[data-theme="light"] .main-nav .nav-btn:hover,
[data-theme="light"] .main-nav .nav-btn.active {
    color: var(--accent-color);
}

[data-theme="light"] .item-tooltip,
[data-theme="light"] #itemTooltip {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(99, 102, 241, 0.5);
    color: var(--text-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .tooltip-name {
    color: var(--text-primary);
}

[data-theme="light"] .tooltip-name.enchanted {
    color: #7c3aed;
}

[data-theme="light"] .tooltip-lore {
    color: #6366f1;
}

[data-theme="light"] .tooltip-enchants .enchant {
    color: #2563eb;
}

[data-theme="light"] .footer {
    background: rgba(255, 255, 255, 0.8);
    border-top: 1px solid rgba(148, 163, 184, 0.3);
}

[data-theme="light"] .search-container input {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.5);
    color: var(--text-primary);
}

[data-theme="light"] .search-container input::placeholder {
    color: var(--text-secondary);
}

/* ============================================
   Light Theme - Store & Modal Overrides
   ============================================ */
[data-theme="light"] .modal-overlay {
    background: rgba(15, 23, 42, 0.5);
}

[data-theme="light"] .modal-content {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(148, 163, 184, 0.4);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .modal-header {
    background: rgba(248, 250, 252, 0.95);
    border-color: rgba(148, 163, 184, 0.3);
}

[data-theme="light"] .store-item-preview {
    background: var(--slot-bg);
    border-color: rgba(148, 163, 184, 0.4);
}

[data-theme="light"] .price-box {
    background: rgba(248, 250, 252, 0.9);
    border-color: rgba(148, 163, 184, 0.4);
}

[data-theme="light"] .price-box.buy {
    background: var(--glass-bg);
    border-color: color-mix(in srgb, var(--accent-color) 30%, transparent);
}

[data-theme="light"] .price-box.sell {
    background: var(--glass-bg);
    border-color: rgba(34, 197, 94, 0.3);
}

[data-theme="light"] .quantity-picker {
    background: rgba(241, 245, 249, 0.9);
}

[data-theme="light"] .qty-btn {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(148, 163, 184, 0.5);
    color: var(--text-primary);
}

[data-theme="light"] .total-price-row {
    background: var(--glass-highlight);
    border-color: color-mix(in srgb, var(--accent-color) 30%, transparent);
}

[data-theme="light"] .store-stock-row {
    background: rgba(248, 250, 252, 0.9);
    border-color: rgba(148, 163, 184, 0.3);
}

[data-theme="light"] .store-item-lore {
    background: var(--slot-bg);
    border-color: rgba(139, 92, 246, 0.25);
    color: #7c3aed;
}

/* ============================================
   Light Theme - Ticket Messages
   ============================================ */
[data-theme="light"] .ticket-messages {
    background: rgba(241, 245, 249, 0.9);
    border-color: rgba(148, 163, 184, 0.3);
}

[data-theme="light"] .ticket-message.player {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

[data-theme="light"] .ticket-message.admin {
    background: var(--accent-color);
    color: white;
}

[data-theme="light"] .ticket-reply {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(148, 163, 184, 0.3);
}

[data-theme="light"] .ticket-reply textarea {
    background: rgba(248, 250, 252, 0.95);
    border-color: rgba(148, 163, 184, 0.4);
    color: var(--text-primary);
}

/* ============================================
   Light Theme - Store Cards
   ============================================ */
[data-theme="light"] .store-item-card {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(148, 163, 184, 0.3);
}

[data-theme="light"] .store-item-card:hover {
    border-color: var(--accent-color);
}

[data-theme="light"] .store-category-chip {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(148, 163, 184, 0.3);
    color: var(--text-primary);
}

[data-theme="light"] .store-category-chip.active {
    background: var(--accent-color);
    color: white;
}

/* Refresh Button */
.refresh-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
    margin-left: 0.5rem;
}

.refresh-btn:hover {
    color: var(--accent-color);
    background: var(--glass-bg);
}

.refresh-btn i {
    font-size: 1rem;
}

.refresh-btn:active i {
    animation: spin 0.5s linear;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   ACCESSIBILITY - SKIP LINK
   ======================================== */

.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    padding: 1rem;
    background: var(--accent-color);
    color: var(--text-on-accent);
    text-decoration: none;
    font-weight: 600;
    z-index: 10000;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

/* ========================================
   ACCESSIBILITY - FOCUS STATES
   ======================================== */

:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-color) 25%, transparent);
}

:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

/* ========================================
   ACCESSIBILITY - REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .slot-item.enchanted {
        animation: none;
        filter: brightness(1.2);
    }
}

/* ========================================
   ACCESSIBILITY - SCREEN READER ONLY
   ======================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE OPTIMIZATIONS
   ======================================== */

@media (max-width: 640px) {

    /* Typography adjustments */
    :root {
        --font-xs: 0.7rem;
        --font-sm: 0.8125rem;
        --font-base: 0.9375rem;
        --font-lg: 1.0625rem;
        --font-xl: 1.1875rem;
        --font-2xl: 1.3125rem;
        --font-3xl: 1.5625rem;
        --font-4xl: 1.875rem;
    }

    /* Compact header */
    .header {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
    }

    /* Larger touch targets */
    .nav-tab,
    .btn-secondary-small,
    .btn-icon {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    /* Hide logo on very small screens */
    .logo-img {
        max-width: 32px;
        height: auto;
    }

    /* Compact state containers */
    .state-container {
        padding: 1rem;
        max-width: 100%;
    }

    /* Landing state adjustments */
    .landing-state h2 {
        font-size: 2rem;
    }

    /* Search input full width on mobile */
    .search-input-large {
        width: 100%;
        max-width: 100%;
    }

    /* Inventory adjustments */
    .inventory-container {
        flex-direction: column;
        gap: 1rem;
    }

    .equipment-sidebar {
        order: 2;
    }

    .main-inventory-area {
        order: 1;
    }

    /* Smaller slots on mobile */
    .inventory-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
    }

    .hotbar-grid {
        gap: 0.5rem;
    }

    /* Slot item adjustments */
    .slot-item {
        width: 45px;
        height: 45px;
    }

    /* Bottom nav spacing */
    .main-content {
        padding-bottom: 80px;
    }

    /* Bottom navigation visible */
    .bottom-nav {
        display: flex;
    }
}

/* ========================================
   MOBILE HAMBURGER MENU
   ======================================== */

.hamburger-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger-btn span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
    border-radius: 2px;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.mobile-menu-overlay.active {
    display: block;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100%;
    background: var(--bg-dark);
    border-left: 1px solid var(--glass-border);
    padding: 1.5rem;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-overlay.active .mobile-menu-content {
    right: 0;
}

.mobile-menu-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 4rem;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

.mobile-nav-item:hover {
    background: var(--accent-color);
    color: var(--text-on-accent);
    border-color: var(--accent-color);
    transform: translateX(-4px);
}

.mobile-nav-item i {
    font-size: 1.25rem;
}

/* Show hamburger on mobile */
@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }

    .header-nav {
        display: none;
    }
}

/* ========================================
   BOTTOM NAVIGATION (MOBILE)
   ======================================== */

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
    padding: 0.75rem 1rem;
    z-index: 999;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

.bottom-nav-item i {
    font-size: 1.5rem;
}

.bottom-nav-item:hover {
    color: var(--text-primary);
    background: var(--glass-highlight);
}

.bottom-nav-item.active {
    color: var(--accent-color);
}

/* ========================================
   ENHANCED HOVER EFFECTS
   ======================================== */

.slot-item:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.slot-item:active {
    transform: translateY(-1px) scale(1.02);
}

/* ========================================
   GLOW EFFECTS
   ======================================== */

.glow-border {
    box-shadow: 0 0 10px var(--accent-color),
        inset 0 0 10px var(--accent-color);
}

/* Apply glow to status badges */

.slot-item.enchanted:hover {
    box-shadow: 0 0 20px var(--enchant-glow-color),
        0 6px 12px rgba(0, 0, 0, 0.3);
}

/* ========================================
   GRADIENT BORDERS
   ======================================== */

/* ========================================
   WEB INTERFACE GUIDELINES - BASELINE
   ======================================== */

/* Native scrollbars/inputs follow the active theme */
:root {
    color-scheme: dark;
}

[data-theme="light"] {
    color-scheme: light;
}

/* Notched devices (viewport-fit=cover) */
body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.bottom-nav {
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
}

h1,
h2,
h3,
h4 {
    text-wrap: balance;
}

/* Numbers that change or get compared shouldn't jitter */
.count,
.price-box,
.price-ingame,
.price-real,
.rank-price,
.real-money-price,
.stat-value,
.store-item-price,
.store-balance-header,
.total-price,
.effect-duration,
.slot .item-count {
    font-variant-numeric: tabular-nums;
}

/* Native select readable in Windows dark mode */
select {
    background-color: var(--glass-bg);
    color: var(--text-primary);
}

/* Scroll inside modals must not chain to the page */
.modal-overlay,
.modal-content {
    overscroll-behavior: contain;
}

/* Long user-generated text (names, lore, tickets) */
.player-name-row h2,
.store-item-name,
.ticket-subject,
.ticket-message,
.tooltip {
    overflow-wrap: anywhere;
}

/* Links/buttons rendered in place of former clickable divs */
a.player-chip,
a.autocomplete-item,
a.search-result-item,
.favorite-chip-link {
    text-decoration: none;
    color: inherit;
}

.favorite-chip-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.remove-favorite {
    background: none;
    border: 0;
    padding: 0.25rem;
    font: inherit;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

button.store-item-card,
button.header-user {
    font: inherit;
    color: inherit;
}

button.store-item-card {
    display: block;
    width: 100%;
}

.store-item-card .store-item-info {
    display: block;
}

.store-item-card .store-item-name,
.store-item-card .store-item-price {
    display: block;
}

button.ticket-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
    text-align: left;
    font: inherit;
    color: inherit;
    background: var(--bg-secondary, var(--glass-bg));
    border: 1px solid var(--border-color, var(--glass-border));
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition-property: var(--transition-props);
    transition-duration: 0.2s;
}

button.ticket-item:hover {
    border-color: var(--accent-color);
}

.ticket-item-left {
    display: block;
    min-width: 0;
}

.ticket-item-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    min-width: 0;
}

.ticket-item-title .ticket-subject {
    font-weight: 600;
    font-size: 1.1rem;
}

.ticket-item-meta {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.ticket-item-meta .badge-primary {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    margin-right: 0.5rem;
}

.ticket-item-right {
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* Accessible toast region (replaces alert()) */
.toast-region {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 11000;
    pointer-events: none;
    width: min(92vw, 420px);
}

.toast {
    pointer-events: auto;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    overflow-wrap: anywhere;
    transition-property: opacity, transform;
    transition-duration: 0.2s;
}

.toast.toast-error {
    border-color: var(--status-offline);
}

.toast.toast-success {
    border-color: var(--status-online);
}

.toast.toast-hide {
    opacity: 0;
    transform: translateY(8px);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.real-money-actions {
    margin-top: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.real-money-actions .real-money-price {
    font-weight: 600;
    margin-right: auto;
}

.item-search-open {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
    margin: 0 auto 3rem;
}

/* ========================================
   THEME CREATOR (premium)
   ======================================== */

.theme-creator-modal {
    max-width: 860px;
    max-height: 90vh;
    overflow-y: auto;
}

.theme-creator-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.theme-creator-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-creator-actions .close-btn {
    margin-left: 0.25rem;
}

.theme-creator-body {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 1.5rem;
}

.theme-name-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.theme-input,
.color-hex {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.65rem;
    font: inherit;
}

.color-section {
    margin-bottom: 1rem;
}

.color-section h4,
.theme-preview h4,
.saved-themes-section h4 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.color-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.5rem 6.5rem;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.color-picker {
    width: 2.5rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: none;
    cursor: pointer;
}

.color-hex {
    width: 100%;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.preview-box {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.preview-header {
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-md);
}

.preview-slots {
    display: flex;
    gap: 0.4rem;
}

.preview-slot {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 4px;
    background: var(--slot-bg);
    border: 2px solid var(--slot-border);
}

.preview-slot.filled {
    background-image: linear-gradient(135deg, var(--accent-color), transparent);
}

.preview-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.preview-secondary {
    color: var(--text-secondary);
}

.saved-themes-section {
    margin-top: 1.25rem;
}

.saved-themes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.saved-theme-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.saved-theme-item.active {
    border-color: var(--accent-color);
}

.saved-theme-color {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
}

.saved-theme-delete {
    background: none;
    border: 0;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
}

@media (max-width: 720px) {
    .theme-creator-body {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   ITEM SEARCH RESULTS
   ======================================== */

#itemSearchResults {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 50vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    transition-property: var(--transition-props);
    transition-duration: 0.15s;
}

.search-result-item:hover,
.search-result-item:focus-visible {
    border-color: var(--accent-color);
    background: var(--glass-highlight);
}

.search-result-item .result-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    image-rendering: pixelated;
}

.search-result-item .result-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.search-result-item .result-item-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.search-result-item .result-player,
.search-result-item .result-location {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ========================================
   LEADERBOARDS (Top)
   ======================================== */
.top-container { max-width: 880px; margin: 0 auto; padding: 1rem 0 3rem; }
.top-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.top-head h2 { display: flex; align-items: center; gap: 0.5rem; font-size: var(--font-xl); }
.top-updated { color: var(--text-secondary); font-size: var(--font-xs); font-variant-numeric: tabular-nums; }
.top-categories { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.top-chip {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.8rem; min-height: 36px;
    border: 1px solid var(--glass-border); border-radius: 999px; background: var(--glass-bg);
    color: var(--text-secondary); font: inherit; font-size: var(--font-sm); cursor: pointer;
    transition-property: color, background-color, border-color; transition-duration: 0.15s;
}
.top-chip:hover { color: var(--text-primary); border-color: var(--text-secondary); }
.top-chip.active { color: var(--text-on-accent); background: var(--accent-color); border-color: var(--accent-color); }
.top-chip:focus-visible, .top-podium-card:focus-visible, .top-row-name:focus-visible { outline: 2px solid var(--status-online); outline-offset: 2px; }

.top-podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; align-items: end; margin-bottom: 1rem; }
.top-podium-card {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
    padding: 1rem 0.5rem; border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
    background: var(--glass-bg); color: var(--text-primary); font: inherit; cursor: pointer;
    transition-property: transform, border-color; transition-duration: 0.2s;
    animation: top-rise 0.35s ease-out both;
}
.top-podium-card:hover { transform: translateY(-2px); border-color: var(--text-secondary); }
.top-podium-card img { border-radius: var(--radius-md); image-rendering: pixelated; }
.top-podium-card.place-1 { order: 2; padding-top: 1.75rem; border-color: #a16207; }
.top-podium-card.place-2 { order: 1; animation-delay: 0.05s; }
.top-podium-card.place-3 { order: 3; animation-delay: 0.1s; }
.top-medal {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%;
    font-weight: 700; font-size: 0.9rem; font-variant-numeric: tabular-nums;
    color: #1a1a1a; background: #c0c7d0;
}
.top-medal.place-1 { background: #f5c542; }
.top-medal.place-3 { background: #d39056; }
.top-name { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-value { color: var(--status-online); font-size: var(--font-sm); font-variant-numeric: tabular-nums; }
.top-online { width: 8px; height: 8px; border-radius: 50%; background: var(--status-online); }
.top-podium-card .top-online { position: absolute; top: 0.6rem; right: 0.6rem; }

.top-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.top-row {
    display: grid; grid-template-columns: 3rem 28px 1fr auto auto auto; align-items: center; gap: 0.6rem;
    padding: 0.5rem 0.75rem; border: 1px solid var(--glass-border); border-radius: var(--radius-md); background: var(--glass-bg);
    animation: top-rise 0.3s ease-out both;
}
.top-row img { border-radius: var(--radius-sm); image-rendering: pixelated; }
.top-rank { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.top-row-name { background: none; border: 0; padding: 0.25rem 0; color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-row-name:hover { text-decoration: underline; }
.top-move { font-size: 0.7rem; }
.top-move.up { color: var(--status-online); }
.top-move.down { color: var(--status-offline); }
.top-move.new { color: #eab308; }
.top-empty, .top-loading { color: var(--text-secondary); text-align: center; padding: 2rem 0; list-style: none; }
.top-empty p { margin: 0; }
.top-empty .top-empty-hint { font-size: 0.85em; opacity: 0.75; margin-top: 0.4rem; max-width: 34rem; margin-inline: auto; }

@keyframes top-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 600px) {
    .top-podium { grid-template-columns: 1fr; }
    .top-podium-card, .top-podium-card.place-1 { order: 0; flex-direction: row; justify-content: flex-start; padding: 0.75rem 1rem; }
    .top-podium-card .top-value { margin-left: auto; }
    .top-podium-card .top-online { position: static; }
    .top-row { grid-template-columns: 2.5rem 28px 1fr auto auto; }
    .top-row .top-move { display: none; }
}
[data-theme="light"] .top-value { color: #15803d; } /* AA contrast on white */

/* Bedrock (Geyser/Floodgate) player badge */
.bedrock-badge {
    display: inline-block; margin-left: 0.4em; padding: 0.05em 0.4em; vertical-align: middle;
    font-size: 0.65em; font-weight: 700; letter-spacing: 0.04em; line-height: 1.5;
    color: var(--text-secondary); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
}
#playerName .bedrock-badge { font-size: 0.4em; }

/* Player header: favorite star next to the name */
.player-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.player-name-row h2 { margin: 0; }
.player-name-row .favorite-btn { margin-left: 0.25rem; }

/* Toolbar (live status, refresh, export) and potion effects, centred under the tabs */
.inventory-state .connection-status {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    margin: -0.5rem auto 1rem;
}
.inventory-state .connection-status .status-text:empty,
.inventory-state .connection-status .status-dot { display: none; }
.inventory-state .connection-status .refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0;
    font-size: 0.9rem;
}
.potion-effects {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}
.potion-effect-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    font-size: 0.9rem;
}
.potion-effect-badge .effect-icon { width: 18px; height: 18px; image-rendering: pixelated; flex-shrink: 0; }
.potion-effect-badge .effect-duration { color: var(--text-secondary); font-variant-numeric: tabular-nums; }

/* Phones: one consistent slot size so a 9-wide row fits 360px+ screens, armor in a row, tabs scroll */
@media (max-width: 640px) {
    :root { --slot-size: 34px; }
    .inventory-container { flex-direction: column; align-items: center; gap: 1rem; }
    .equipment-sidebar { flex-direction: row; align-items: flex-end; gap: 0.75rem; order: 1; }
    .main-inventory-area { order: 2; }
    .armor-grid { grid-template-columns: repeat(4, var(--slot-size)); }
    .inventory-grid,
    .hotbar-grid,
    .enderchest-grid {
        grid-template-columns: repeat(9, var(--slot-size));
        gap: 3px;
        padding: 0.4rem;
        width: auto;
        overflow: visible;
    }
    .slot { width: var(--slot-size); height: var(--slot-size); }
    .slot-item { width: 28px; height: 28px; }
    .main-nav {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.15rem;
        overflow-x: auto;
        scrollbar-width: none;
        padding: 0 0.25rem;
    }
    .main-nav::-webkit-scrollbar { display: none; }
    .nav-btn { flex: 0 0 auto; white-space: nowrap; font-size: 0.85rem; padding: 0.5rem 0.45rem; }
    .store-items-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
    .store-item-card { padding: 1rem 0.5rem; }
}

/* Switched off by the server owner (web.ui.* in config.yml) */
.ui-off { display: none !important; }

/* Limited stock on a store card */
.store-stock-badge {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.store-stock-badge.out { color: #ef4444; }
.store-item-card.out-of-stock { opacity: 0.55; }

/* Home: most played (top 3 of the playtime board) */
.home-top { margin-top: 2rem; }
.home-top .home-top-rank { color: var(--text-secondary); font-weight: 600; font-variant-numeric: tabular-nums; }
.home-top .home-top-value { color: var(--text-secondary); font-size: 0.85em; font-variant-numeric: tabular-nums; }
.home-top-link {
    display: inline-block;
    margin-top: 0.85rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.home-top-link:hover { color: var(--text-primary); }

/* Account link on the Support page (servers without a web store link from here) */
.tickets-link { max-width: 360px; margin: 0 auto; }
.tickets-link .link-code-display { margin-top: 1rem; }

/* "No map" message sits in the middle of the map area */
.map-state .error-state { margin: auto; }

/* Buyer's message in the store item window */
.store-message { margin: 0 0 1.25rem; }
.store-message label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.store-message input {
    width: 100%;
    padding: 0.7rem 0.85rem;
    background: var(--slot-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font: inherit;
}
.store-message input:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 1px; }
.store-message input[aria-invalid="true"] { border-color: #ef4444; }
.store-message-hint {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.store-message-count { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ========================================
   Phones and small tablets
   ======================================== */
button,
a,
.slot,
.store-item-card {
    touch-action: manipulation; /* no double-tap zoom delay */
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
    /* The page scrolls, not an inner box: the address bar can collapse and nothing hides behind it */
    body {
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }
    .app {
        height: auto;
        min-height: 100dvh;
    }
    .main-content {
        overflow: visible;
        padding: 1rem;
    }
    .header {
        position: sticky;
        top: 0;
    }
    /* the map keeps a full screen to draw in */
    .main-content.full-width-mode,
    .map-state,
    .map-frame {
        min-height: calc(100dvh - 72px);
    }

    /* 16px inputs: iOS does not zoom the page when they get focus */
    input,
    select,
    textarea {
        font-size: max(16px, 1em);
    }

    .qty-btn {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
    }
}

@media (max-width: 640px) {
    /* Windows become bottom sheets: full width, thumb-reachable buttons, scroll inside */
    .modal-overlay {
        align-items: flex-end;
    }
    .modal-overlay .modal-content {
        width: 100%;
        max-width: 100% !important;
        max-height: 92dvh;
        overflow-y: auto;
        border-radius: 18px 18px 0 0;
        border-bottom: 0;
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    }
    .store-item-modal .modal-body {
        padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
    }
    .store-item-preview {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }
    .store-item-preview img {
        width: 72px;
        height: 72px;
    }

    /* Profile tabs scroll sideways; the fade says there is more */
    .main-nav {
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
        mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
        scroll-snap-type: x proximity;
    }
    .main-nav .nav-btn {
        scroll-snap-align: start;
    }

    .store-message-hint {
        flex-wrap: wrap;
    }
    .landing-state {
        padding: 2rem 0.5rem;
    }
    .landing-state h2 {
        font-size: 2rem;
    }
    .landing-search {
        flex-wrap: wrap;
    }
    .landing-search .search-input-large {
        flex: 1 1 100%;
    }
    .landing-search .search-btn-large {
        flex: 1 1 100%;
        min-height: 48px;
    }
    .store-categories-bar {
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
        mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
        gap: 0.6rem;
        margin-bottom: 1rem;
    }
}

/* Purchase rules in the store item window */
.store-item-rules {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.store-item-rules li {
    font-size: 0.8rem;
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    color: var(--text-secondary);
}
