/* ============================================================
   RuneScape 3 — Authentic Game UI Theme
   Full overhaul: ornate panels, gold trim, stone textures
   ============================================================ */

/* Fonts: Cinzel for RS3 heraldic titles, Crimson Text for body */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Cinzel+Decorative:wght@400;700&family=Crimson+Text:ital,wght@0,400;0,600;1,400&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

/* ============================================================
   RS3 Color Tokens
   ============================================================ */
:root {
    /* Core backgrounds — dark stone/leather */
    --bg-primary:     #0d0b09;
    --bg-secondary:   #161210;
    --bg-tertiary:    #1e1a15;
    --bg-panel:       #1a1510;
    --bg-panel-inner: #120f0b;

    /* Text hierarchy */
    --text-primary:   #e8dfc8;
    --text-secondary: #c4b896;
    --text-muted:     #8a7d65;
    --text-title:     #f5e9c8;

    /* RS3 Gold spectrum */
    --gold-dim:       #7a6535;
    --gold:           #c9a54a;
    --gold-bright:    #f0d070;
    --gold-shimmer:   #ffe89a;

    /* Status */
    --success:        #5a9e5a;
    --error:          #b84040;
    --warning:        #c8882a;

    /* Border system — multi-layer metallic */
    --border-outer:   #5c4e32;
    --border-mid:     #3a2e1a;
    --border-inner:   #2a2218;
    --border-gold:    #8a7040;
    --border-bright:  #c9a54a;

    /* Shadows */
    --shadow-sm:   0 2px 6px rgba(0,0,0,0.6);
    --shadow-md:   0 4px 14px rgba(0,0,0,0.7);
    --shadow-lg:   0 8px 28px rgba(0,0,0,0.8);
    --shadow-inset: inset 0 2px 6px rgba(0,0,0,0.8);
    --glow-gold:   0 0 12px rgba(201,165,74,0.35);

    /* RS-specific */
    --rs-gold:   #c9a54a;
    --rs-bronze: #a0672a;
    --rs-silver: #c8c8c8;
}

[data-theme="light"] {
    --bg-primary:     #e8e0d0;
    --bg-secondary:   #d8cfc0;
    --bg-tertiary:    #ccc3b0;
    --bg-panel:       #e0d8c8;
    --bg-panel-inner: #d0c8b8;
    --text-primary:   #1a140a;
    --text-secondary: #3a2e18;
    --text-muted:     #5a4e38;
    --text-title:     #140e04;
    --border-outer:   #8a7855;
    --border-mid:     #b0a080;
    --border-inner:   #c8b890;
    --shadow-sm:   0 2px 6px rgba(0,0,0,0.2);
    --shadow-md:   0 4px 14px rgba(0,0,0,0.25);
    --shadow-lg:   0 8px 28px rgba(0,0,0,0.3);
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    vertical-align: middle;
}

/* ============================================================
   Body & Texture
   ============================================================ */
body {
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 16px;
    background-color: var(--bg-primary);
    /* Stone texture via repeating SVG noise pattern */
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E"),
        linear-gradient(180deg, #0d0b09 0%, #110e09 40%, #0a0806 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================================
   RS3 Panel Mixin — the core ornate bordered panel
   ============================================================ */
.rs-panel,
.card,
.search-box,
.stat-card,
.player-header,
.skill-card,
.item-card,
.stat-box,
.hero-section,
.quick-action-btn {
    background: var(--bg-panel);
    /* Layered border simulating RS3's metallic trim */
    border: 3px solid var(--border-outer);
    outline: 1px solid var(--border-mid);
    outline-offset: -5px;
    box-shadow:
        var(--shadow-md),
        inset 0 0 0 1px var(--border-inner),
        inset 0 2px 8px rgba(0,0,0,0.6);
    position: relative;
}

/* Gold top-edge accent line on all panels */
.rs-panel::before,
.card::before,
.search-box::before,
.stat-card::before,
.player-header::before,
.hero-section::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 16px;
    right: 16px;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--gold-dim) 15%,
        var(--gold) 40%,
        var(--gold-bright) 50%,
        var(--gold) 60%,
        var(--gold-dim) 85%,
        transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* ============================================================
   Corner Ornament — decorative corner diamonds on panels
   ============================================================ */
.card::after,
.search-box::after,
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 16px;
    right: 16px;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--gold-dim) 15%,
        var(--gold) 40%,
        var(--gold-bright) 50%,
        var(--gold) 60%,
        var(--gold-dim) 85%,
        transparent 100%);
    pointer-events: none;
}

/* ============================================================
   Container
   ============================================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================
   Navigation — RS3 Top Menu Bar
   ============================================================ */
nav {
    background: linear-gradient(180deg, #1c1710 0%, #110e08 100%);
    border-bottom: 3px solid var(--border-outer);
    box-shadow:
        0 4px 16px rgba(0,0,0,0.8),
        inset 0 -1px 0 var(--gold-dim);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.85rem 0;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 1.5rem;
}

nav h1 {
    font-family: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold-bright);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 0 20px rgba(201,165,74,0.3);
}

nav h1 .material-symbols-outlined {
    font-size: 2rem;
    color: var(--rs-gold);
    filter: drop-shadow(0 0 6px rgba(201,165,74,0.5));
}

nav ul {
    display: flex;
    gap: 0.15rem;
    list-style: none;
    flex: 1;
    justify-content: center;
    flex-wrap: nowrap;
}

nav a {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.15s ease;
    padding: 0.4rem 0.6rem;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    border: 1px solid transparent;
    white-space: nowrap;
}

nav a span:last-child {
    font-size: 0.65rem;
    line-height: 1;
}

nav a .material-symbols-outlined {
    font-size: 20px;
}

nav a:hover {
    color: var(--gold-bright);
    background: rgba(201, 165, 74, 0.12);
    border-color: var(--gold-dim);
    text-shadow: 0 0 10px rgba(201,165,74,0.4);
}

nav a.active {
    color: var(--gold-shimmer);
    background: rgba(201, 165, 74, 0.18);
    border-color: var(--gold-dim);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5), 0 0 8px rgba(201,165,74,0.15);
    text-shadow: 0 0 12px rgba(201,165,74,0.5);
}

/* ============================================================
   Theme Toggle
   ============================================================ */
.theme-toggle {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(180deg, #2a2218 0%, #1a1510 100%);
    border: 2px solid var(--border-outer);
    border-radius: 3px;
    color: var(--text-secondary);
    padding: 0.45rem 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.theme-toggle .material-symbols-outlined { font-size: 18px; }

.theme-toggle:hover {
    background: linear-gradient(180deg, #342a1c 0%, #24190f 100%);
    border-color: var(--border-bright);
    color: var(--gold-bright);
    box-shadow: var(--shadow-md), var(--glow-gold);
}

/* ============================================================
   Main & Footer
   ============================================================ */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

footer {
    background: linear-gradient(180deg, #0d0b09 0%, #08060400 100%);
    border-top: 3px solid var(--border-outer);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-muted);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.6);
    font-family: 'Crimson Text', Georgia, serif;
}

/* ============================================================
   Search Box
   ============================================================ */
.search-box {
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 4px;
}

.search-box h2 {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gold-bright);
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-outer);
}

.search-form {
    display: flex;
    gap: 0.75rem;
}

/* ============================================================
   Inputs
   ============================================================ */
input[type="text"],
select {
    flex: 1;
    padding: 0.65rem 1rem;
    background: var(--bg-panel-inner);
    border: 2px solid var(--border-mid);
    border-radius: 2px;
    color: var(--text-primary);
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 1rem;
    box-shadow: var(--shadow-inset);
    outline: 1px solid var(--border-inner);
    outline-offset: -3px;
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--gold-dim);
    box-shadow: var(--shadow-inset), 0 0 0 2px rgba(201,165,74,0.2);
    color: var(--text-title);
}

input[type="text"]::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================================
   Buttons — RS3 metallic style
   ============================================================ */
button {
    padding: 0.65rem 1.4rem;
    background: linear-gradient(180deg,
        #d4a840 0%,
        #b8892a 40%,
        #9a7020 80%,
        #7a5810 100%);
    color: #1a1005;
    border: 2px solid var(--border-outer);
    border-radius: 2px;
    cursor: pointer;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow:
        var(--shadow-sm),
        inset 0 1px 0 rgba(255,235,130,0.3),
        inset 0 -2px 4px rgba(0,0,0,0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    outline: 1px solid var(--border-mid);
    outline-offset: -3px;
}

button .material-symbols-outlined { font-size: 18px; }

button:active {
    transform: translateY(1px);
    background: linear-gradient(180deg,
        #9a7020 0%,
        #b8892a 100%);
    box-shadow: var(--shadow-sm), inset 0 2px 6px rgba(0,0,0,0.5);
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.4);
}

/* Secondary/muted button variant */
button.btn-secondary {
    background: linear-gradient(180deg, #2a2218 0%, #1a1510 100%);
    color: var(--text-secondary);
    border-color: var(--border-outer);
}

/* ============================================================
   Cards — Ornate RS3 Panels
   ============================================================ */
.card {
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    border-radius: 4px;
}

.card h2,
.card h3 {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gold-bright);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.7);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* Separator uses gradient like RS3 divider */
    border-bottom: 1px solid transparent;
    border-image: linear-gradient(90deg,
        transparent,
        var(--border-bright) 20%,
        var(--gold-dim) 50%,
        var(--border-bright) 80%,
        transparent) 1;
}

.card h2 .material-symbols-outlined,
.card h3 .material-symbols-outlined {
    font-size: 26px;
    color: var(--rs-gold);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

/* ============================================================
   Stats Grid & Items
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-item {
    background: var(--bg-panel-inner);
    padding: 1rem;
    border-radius: 3px;
    border: 2px solid var(--border-mid);
    box-shadow: var(--shadow-sm), inset 0 1px 4px rgba(0,0,0,0.5);
    outline: 1px solid var(--border-inner);
    outline-offset: -4px;
}

.stat-item .label {
    font-family: 'Cinzel', Georgia, serif;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.stat-item .label .material-symbols-outlined { font-size: 14px; }

.stat-item .value {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--gold-bright);
    margin-top: 0.25rem;
    text-shadow: 0 0 10px rgba(201,165,74,0.25);
}

/* ============================================================
   Alert: Loading / Error / Success
   ============================================================ */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--gold);
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.loading .material-symbols-outlined {
    animation: rs-spin 1s linear infinite;
    color: var(--gold-bright);
}

@keyframes rs-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.error {
    background: rgba(184, 64, 64, 0.12);
    color: #e87070;
    padding: 1rem 1.25rem;
    border: 2px solid var(--error);
    border-radius: 3px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm), inset 0 1px 4px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 1rem;
}

.error .material-symbols-outlined { font-size: 22px; flex-shrink: 0; }

.success {
    background: rgba(90, 158, 90, 0.12);
    color: #80c880;
    padding: 1rem 1.25rem;
    border: 2px solid var(--success);
    border-radius: 3px;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm), inset 0 1px 4px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 1rem;
}

.success .material-symbols-outlined { font-size: 22px; flex-shrink: 0; }

/* ============================================================
   Tables — RS3 Hiscores Style
   ============================================================ */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-panel);
    border: 3px solid var(--border-outer);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--shadow-md), inset 0 0 0 1px var(--border-inner);
}

thead {
    background: linear-gradient(180deg, #201810 0%, #140f08 100%);
}

th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-family: 'Cinzel', Georgia, serif;
    color: var(--gold-bright);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-size: 0.75rem;
    border-bottom: 2px solid var(--border-bright);
    text-shadow: 0 2px 4px rgba(0,0,0,0.7);
}

td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border-inner);
    color: var(--text-primary);
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.97rem;
}

tr:hover td {
    background: rgba(201, 165, 74, 0.06);
    color: var(--text-title);
}

tr:last-child td { border-bottom: none; }

/* Rank badges */
.rank-1 {
    color: var(--gold-shimmer);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255,232,154,0.6);
}
.rank-2 {
    color: var(--rs-silver);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(200,200,200,0.5);
}
.rank-3 {
    color: var(--rs-bronze);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(160,103,42,0.5);
}

/* ============================================================
   Scrollbars — RS3 Dark Style
   ============================================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }

::-webkit-scrollbar-track {
    background: var(--bg-panel-inner);
    border: 1px solid var(--border-inner);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--border-outer), var(--border-mid));
    border: 1px solid var(--border-inner);
    border-radius: 2px;
}

/* ============================================================
   Links
   ============================================================ */
a {
    color: var(--gold);
    text-decoration: none;
}

/* ============================================================
   Select Dropdown
   ============================================================ */
select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23c9a54a' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ============================================================
   Feature List
   ============================================================ */
.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-inner);
}

.feature-list li:last-child { border-bottom: none; }

.feature-list li .material-symbols-outlined {
    color: var(--success);
    font-size: 18px;
    filter: drop-shadow(0 0 4px rgba(90,158,90,0.4));
}

/* ============================================================
   Live Player Count
   ============================================================ */
#live-player-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    background: linear-gradient(180deg, #1e1a12 0%, #140f08 100%);
    border: 2px solid var(--border-outer);
    border-radius: 3px;
    color: var(--gold-bright);
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
    outline: 1px solid var(--border-inner);
    outline-offset: -3px;
}

#live-player-count .material-symbols-outlined {
    font-size: 18px;
    color: var(--success);
    filter: drop-shadow(0 0 4px rgba(90,158,90,0.5));
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse { animation: pulse 0.5s ease; }

/* ============================================================
   Stats Dashboard
   ============================================================ */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.5rem;
    border-radius: 4px;
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.stat-card-header .material-symbols-outlined {
    font-size: 22px;
    color: var(--rs-gold);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--gold-bright);
    line-height: 1;
    text-shadow: 0 0 12px rgba(201,165,74,0.2);
}

.stat-card-label {
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.9rem;
}

/* ============================================================
   Hero Section — Ornate Header Banner
   ============================================================ */
.hero-section {
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    text-align: center;
    border-radius: 4px;
    /* Extra side accent lines */
    background-image:
        linear-gradient(90deg,
            rgba(201,165,74,0.04) 0%,
            transparent 25%,
            transparent 75%,
            rgba(201,165,74,0.04) 100%),
        linear-gradient(180deg, #1c1610 0%, #110d08 100%);
    overflow: hidden;
}

.hero-section h1 {
    font-family: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--gold-bright);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-shadow: 0 4px 12px rgba(0,0,0,0.8), 0 0 30px rgba(201,165,74,0.25);
    letter-spacing: 2px;
}

.hero-section h1 .material-symbols-outlined {
    font-size: 2.8rem;
    color: var(--rs-gold);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6)) drop-shadow(0 0 12px rgba(201,165,74,0.4));
}

.hero-section p {
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    font-style: italic;
}

/* ============================================================
   Quick Actions
   ============================================================ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: 4px;
    background: linear-gradient(180deg, #1e1a14 0%, #14100a 100%);
}

.quick-action-btn .material-symbols-outlined {
    font-size: 44px;
    color: var(--rs-gold);
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

.quick-action-btn:hover .material-symbols-outlined {
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)) drop-shadow(0 0 10px rgba(201,165,74,0.4));
}

.quick-action-btn span:last-child {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gold-bright);
    text-align: center;
}

/* ============================================================
   Info Grid
   ============================================================ */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ============================================================
   Stat Box
   ============================================================ */
.stat-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 3px;
    background: var(--bg-panel-inner);
}

.stat-box .material-symbols-outlined {
    font-size: 2.2rem;
    opacity: 0.85;
    color: var(--rs-gold);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.stat-label {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Crimson Text', Georgia, serif;
}

/* ============================================================
   Player Profile Header
   ============================================================ */
.player-header {
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 4px;
    background-image: linear-gradient(135deg, #1e1a14 0%, #0e0b07 100%);
    overflow: hidden;
}

.player-header-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
    align-items: center;
}

.player-avatar-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
}

.player-avatar-img,
.player-avatar-fallback {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--border-outer);
    box-shadow: 0 8px 24px rgba(0,0,0,0.7), 0 0 20px rgba(201,165,74,0.2);
    background: var(--bg-panel-inner);
    object-fit: cover;
}

.player-avatar-fallback {
    background: linear-gradient(135deg, var(--gold-dim) 0%, #5a4020 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 3rem;
    color: var(--gold-bright);
    font-weight: 700;
    border-radius: 50%;
}

.avatar-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--bg-secondary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

.avatar-badge .material-symbols-outlined { font-size: 18px; }

.master-badge {
    background: linear-gradient(135deg, #d4a830 0%, #f0d060 100%);
    color: #1a0e00;
}

.maxed-badge {
    background: linear-gradient(135deg, #a0a0a0 0%, #e0e0e0 100%);
    color: #1a1a1a;
    bottom: -5px;
    right: 28px;
}

.player-info h2 {
    font-family: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
    font-size: 1.8rem;
    color: var(--gold-bright);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-shadow: 0 4px 10px rgba(0,0,0,0.7), 0 0 20px rgba(201,165,74,0.2);
    letter-spacing: 1px;
}

.player-info h2 .material-symbols-outlined {
    font-size: 1.8rem;
    color: var(--rs-gold);
}

.player-stats-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.summary-stat {
    text-align: center;
    padding: 0.85rem;
    background: var(--bg-panel-inner);
    border-radius: 3px;
    border: 2px solid var(--border-mid);
    box-shadow: var(--shadow-inset);
    outline: 1px solid var(--border-inner);
    outline-offset: -4px;
}

.summary-stat-label {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-weight: 600;
}

.summary-stat-label .material-symbols-outlined { font-size: 14px; }

.summary-stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--gold-bright);
    line-height: 1;
    text-shadow: 0 0 12px rgba(201,165,74,0.2);
}

.summary-stat-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-family: 'Crimson Text', Georgia, serif;
    font-style: italic;
}

.player-achievements {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.achievement-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.7rem;
    background: linear-gradient(180deg, #1e1a12 0%, #140f08 100%);
    border: 2px solid var(--border-outer);
    border-radius: 3px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
}

.achievement-badge .material-symbols-outlined {
    font-size: 14px;
    color: var(--rs-gold);
}

.achievement-badge.master {
    border-color: #c9a030;
    background: linear-gradient(180deg, rgba(201,160,48,0.12) 0%, rgba(120,80,10,0.08) 100%);
    color: var(--gold-bright);
}

.achievement-badge.master .material-symbols-outlined { color: var(--gold-shimmer); }

.achievement-badge.legendary {
    border-color: #aa4040;
    background: linear-gradient(180deg, rgba(170,64,64,0.12) 0%, rgba(80,20,20,0.08) 100%);
    color: #f09090;
}

.achievement-badge.legendary .material-symbols-outlined { color: #f09090; }

.share-button {
    padding: 0.65rem 1.2rem !important;
    height: fit-content;
}

/* ============================================================
   Skill Cards
   ============================================================ */
.skill-category {
    margin-bottom: 2rem;
}

.skill-category h3 {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-bright);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    text-shadow: 0 2px 6px rgba(0,0,0,0.7);
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--border-bright), transparent) 1;
}

.skill-category h3 .material-symbols-outlined {
    font-size: 1.3rem;
    color: var(--rs-gold);
}

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

.skill-card {
    background: linear-gradient(160deg, #1e1a14 0%, #14100a 100%);
    border: 2px solid var(--border-outer);
    border-radius: 3px;
    padding: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border-inner);
}

/* Animated top accent */
.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0;
}

.skill-card:hover::before {
    opacity: 1;
}

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

.skill-name {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}

.skill-level-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-level {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold-bright);
    text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.virtual-level {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}

.skill-rank-badge {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-outer);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.skill-rank-badge .material-symbols-outlined { font-size: 14px; }

.skill-rank-badge.master {
    background: linear-gradient(135deg, #d4a830 0%, #f0e060 100%);
    color: #1a0e00;
    border-color: #d4a830;
}

.skill-rank-badge.maxed {
    background: linear-gradient(135deg, #a0a0a0 0%, #e0e0e0 100%);
    color: #1a1a1a;
    border-color: #a0a0a0;
}

.skill-xp {
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.skill-xp-remaining {
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-style: italic;
}

/* Progress bar */
.skill-progress {
    width: 100%;
    height: 5px;
    background: var(--bg-panel-inner);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.6);
    border: 1px solid var(--border-inner);
}

.skill-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dim) 0%, var(--gold) 50%, var(--gold-bright) 100%);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(201,165,74,0.5);
}

/* Skill card rank variants */
.skill-card.rank-master {
    border-color: rgba(201,165,74,0.5);
    background: linear-gradient(160deg,
        rgba(201,165,74,0.06) 0%,
        #14100a 100%);
}

.skill-card.rank-master::before {
    background: linear-gradient(90deg, transparent, #d4a830, #f0e060, #d4a830, transparent);
    opacity: 1;
}

.skill-card.rank-master .skill-level {
    color: var(--gold-shimmer);
    text-shadow: 0 0 10px rgba(255,232,154,0.5);
}

.skill-card.rank-master .skill-progress-bar {
    background: linear-gradient(90deg, #c09020 0%, #f0d040 100%);
    box-shadow: 0 0 12px rgba(201,165,74,0.6);
}

.skill-card.rank-maxed {
    border-color: rgba(192,192,192,0.4);
    background: linear-gradient(160deg,
        rgba(192,192,192,0.05) 0%,
        #14100a 100%);
}

.skill-card.rank-maxed::before {
    background: linear-gradient(90deg, transparent, #a0a0a0, #e0e0e0, #a0a0a0, transparent);
    opacity: 1;
}

.skill-card.rank-maxed .skill-level {
    color: #e8e8e8;
    text-shadow: 0 0 8px rgba(200,200,200,0.5);
}

.skill-card.rank-maxed .skill-progress-bar {
    background: linear-gradient(90deg, #909090 0%, #e0e0e0 100%);
    box-shadow: 0 0 10px rgba(200,200,200,0.4);
}

.skill-card.rank-high {
    border-color: rgba(138,112,64,0.4);
}

.skill-card.rank-high .skill-progress-bar {
    background: linear-gradient(90deg, #7a6535 0%, #a89050 100%);
}

/* Glowing max-level numbers */
.skill-card[data-level="99"] .skill-level,
.skill-card[data-level="120"] .skill-level {
    animation: rs-glow 2.5s ease-in-out infinite;
}

@keyframes rs-glow {
    0%, 100% { text-shadow: 0 0 8px currentColor; }
    50% { text-shadow: 0 0 18px currentColor, 0 0 30px currentColor; }
}

/* ============================================================
   Combat Badge
   ============================================================ */
.combat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(180deg, #7a2020 0%, #4a1010 100%);
    border: 3px solid #8b2e2e;
    border-radius: 3px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1rem;
    font-weight: 700;
    color: #ffcccc;
    box-shadow: 0 4px 12px rgba(120,30,30,0.5), inset 0 1px 0 rgba(255,120,120,0.15);
    text-shadow: 0 2px 4px rgba(0,0,0,0.7);
    letter-spacing: 0.5px;
    outline: 1px solid rgba(100,20,20,0.6);
    outline-offset: -4px;
}

.combat-badge .material-symbols-outlined { font-size: 1.4rem; }

/* ============================================================
   Item Cards
   ============================================================ */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.item-card {
    background: linear-gradient(160deg, #1e1a14 0%, #110d08 100%);
    border: 3px solid var(--border-outer);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border-inner);
}

a.item-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.item-image {
    position: relative;
    background: linear-gradient(160deg, #14100a 0%, #0a0806 100%);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    border-bottom: 2px solid var(--border-outer);
}

.item-image img {
    max-width: 100%;
    max-height: 110px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.7));
}

.members-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #c09020 0%, #f0d040 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(192,144,32,0.5);
    border: 2px solid #80600a;
}

.members-badge .material-symbols-outlined {
    font-size: 16px;
    color: #1a0e00;
}

.item-info { padding: 1rem; }

.item-name {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gold-bright);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

.item-description {
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-style: italic;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-inner);
}

.item-type {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
}

.item-type .material-symbols-outlined { font-size: 14px; }

.item-id {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

.item-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-panel-inner);
    border-radius: 3px;
    border: 2px solid var(--border-mid);
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.5);
}

.price-label {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.price-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gold-bright);
    flex: 1;
    text-shadow: 0 0 8px rgba(201,165,74,0.2);
}

.price-trend { font-size: 18px; }

/* ============================================================
   Loading Spinner & Skeleton Loaders
   ============================================================ */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-outer);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: rs-spin 0.8s linear infinite;
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 0%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 2rem;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-card {
    height: 200px;
    width: 100%;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   Responsive — Mobile
   ============================================================ */
@media (max-width: 1024px) {
    nav .container { flex-wrap: wrap; }

    nav ul {
        order: 3;
        width: 100%;
        margin-top: 0.5rem;
        justify-content: center;
    }

    #live-player-count {
        font-size: 0.7rem;
        padding: 0.35rem 0.7rem;
    }
}

@media (max-width: 768px) {
    .search-form { flex-direction: column; }
    .stats-grid  { grid-template-columns: 1fr; }
    .items-grid  { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }

    nav a span:last-child    { display: none; }
    nav a .material-symbols-outlined { margin: 0; }
    nav h1 { font-size: 1.1rem; }

    .hero-section h1 { font-size: 1.6rem; letter-spacing: 1px; }
    .hero-section h1 .material-symbols-outlined { font-size: 2rem; }
    .stat-card-value { font-size: 1.5rem; }
    .quick-action-btn .material-symbols-outlined { font-size: 32px; }

    .player-header-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .player-avatar-wrapper { margin: 0 auto; }
    .player-stats-summary { grid-template-columns: 1fr; }
    .skills-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}


/* ============================================================
   Favorites System
   ============================================================ */
.favorite-btn {
    background: transparent;
    border: 2px solid var(--border-outer);
    border-radius: 4px;
    padding: 0.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.favorite-btn.is-favorite {
    background: rgba(201, 165, 74, 0.15);
    border-color: var(--gold);
    color: var(--gold-bright);
}

.favorite-btn .material-symbols-outlined {
    font-size: 20px;
}

/* Favorites Toast Notification */
.favorites-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-panel);
    border: 2px solid var(--border-outer);
    border-radius: 6px;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
}

.favorites-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Favorites Page Styles */
.favorites-section {
    margin-bottom: 3rem;
}

.favorites-grid {
    width: 100%;
}

/* Player Cards */
.favorite-player-card {
    background: var(--bg-panel);
    border: 3px solid var(--border-outer);
    border-radius: 6px;
    padding: 1.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.favorite-player-star {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.favorite-player-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid var(--gold);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.favorite-player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.favorite-player-name {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold-bright);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

.favorite-player-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

.favorite-player-date .material-symbols-outlined {
    font-size: 14px;
}

.favorite-player-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    width: 100%;
    margin-bottom: 1rem;
}

.favorite-stat-item {
    background: var(--bg-panel-inner);
    border: 2px solid var(--border-mid);
    border-radius: 4px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.favorite-stat-item .material-symbols-outlined {
    font-size: 20px;
    color: var(--gold);
}

.favorite-stat-item .stat-label {
    font-size: 0.7rem;
}

.favorite-stat-item .stat-value {
    font-size: 1.2rem;
}

.favorite-player-xp {
    background: var(--bg-panel-inner);
    border: 2px solid var(--border-mid);
    border-radius: 4px;
    padding: 0.75rem;
    width: 100%;
    margin-bottom: 1rem;
}

.favorite-player-xp .stat-label {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.favorite-player-xp .stat-value {
    font-size: 1.1rem;
    color: var(--gold-bright);
}

.favorite-player-unavailable {
    background: var(--bg-panel-inner);
    border: 2px solid var(--border-mid);
    border-radius: 4px;
    padding: 1.5rem;
    width: 100%;
    margin-bottom: 1rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.favorite-player-unavailable .material-symbols-outlined {
    font-size: 2rem;
    opacity: 0.5;
}

.favorite-player-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(180deg, #d4a840 0%, #b8892a 40%, #9a7020 80%, #7a5810 100%);
    color: #1a1005;
    border: 2px solid var(--border-outer);
    border-radius: 4px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.favorite-player-btn .material-symbols-outlined {
    font-size: 18px;
}

/* ============================================================
   Favorites Page - Clean Redesign
   ============================================================ */

/* Player Cards Grid */
.faves-player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.faves-player-card {
    background: var(--bg-panel);
    border: 2px solid var(--border-outer);
    border-radius: 4px;
    padding: 0.85rem 0.65rem;
    position: relative;
    text-align: center;
}

.faves-star-btn {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: rgba(201, 165, 74, 0.15);
    border: 2px solid var(--gold);
    border-radius: 3px;
    padding: 0.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-bright);
    z-index: 10;
}

.faves-star-btn .material-symbols-outlined {
    font-size: 15px;
}

.faves-player-avatar {
    width: 60px;
    height: 60px;
    margin: 0 auto 0.6rem;
    border-radius: 50%;
    border: 3px solid var(--gold);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.faves-player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.faves-player-name {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gold-bright);
    margin-bottom: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 0.2rem;
    line-height: 1.2;
}

.faves-player-date {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
    line-height: 1;
}

.faves-player-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}

.faves-stat {
    background: var(--bg-panel-inner);
    border: 1px solid var(--border-mid);
    border-radius: 3px;
    padding: 0.35rem 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.faves-stat .material-symbols-outlined {
    font-size: 13px;
    color: var(--gold);
    flex-shrink: 0;
}

.faves-stat > div {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.faves-stat-label {
    font-size: 0.55rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
    margin-bottom: 0.15rem;
}

.faves-stat-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
}

.faves-player-xp {
    background: var(--bg-panel-inner);
    border: 1px solid var(--border-mid);
    border-radius: 3px;
    padding: 0.35rem 0.4rem;
    margin-bottom: 0.55rem;
}

.faves-player-xp .faves-stat-label {
    margin-bottom: 0.2rem;
    text-align: center;
}

.faves-player-xp .faves-stat-value {
    color: var(--gold-bright);
    font-size: 0.9rem;
    text-align: center;
}

.faves-unavailable {
    background: var(--bg-panel-inner);
    border: 1px solid var(--border-mid);
    border-radius: 3px;
    padding: 0.65rem 0.4rem;
    margin-bottom: 0.55rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.faves-unavailable .material-symbols-outlined {
    font-size: 1.3rem;
    opacity: 0.5;
}

.faves-view-btn {
    width: 100%;
    padding: 0.5rem;
    background: linear-gradient(180deg, #d4a840 0%, #b8892a 50%, #9a7020 100%);
    color: #1a1005;
    border: 2px solid var(--border-outer);
    border-radius: 3px;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.faves-view-btn .material-symbols-outlined {
    font-size: 13px;
}

/* Items Grid - Full Width */
.faves-items-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
    width: 100%;
}

.faves-item-card {
    background: var(--bg-panel);
    border: 2px solid var(--border-outer);
    border-radius: 4px;
    position: relative;
}

.faves-item-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.faves-item-link img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.faves-item-name {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold-bright);
    text-align: center;
    margin-bottom: 0.25rem;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.faves-item-price {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Clans Row */
.faves-clans-row {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.faves-clans-row::-webkit-scrollbar {
    height: 6px;
}

.faves-clans-row::-webkit-scrollbar-track {
    background: var(--bg-panel-inner);
    border-radius: 3px;
}

.faves-clans-row::-webkit-scrollbar-thumb {
    background: var(--border-outer);
    border-radius: 3px;
}

.faves-clan-card {
    background: var(--bg-panel);
    border: 2px solid var(--border-outer);
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    width: 140px;
}

.faves-clan-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.faves-clan-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-dim) 0%, #5a4020 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    border: 3px solid var(--gold);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.faves-clan-icon .material-symbols-outlined {
    font-size: 2rem;
    color: var(--gold-bright);
}

.faves-clan-name {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gold-bright);
    text-align: center;
    margin-bottom: 0.25rem;
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.faves-clan-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.empty-favorites {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-favorites .material-symbols-outlined {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}


/* ============================================================
   Autocomplete Dropdown
   ============================================================ */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-panel);
    border: 2px solid var(--border-outer);
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-inner);
}

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

.autocomplete-item:hover,
.autocomplete-item.active {
    background: rgba(201, 165, 74, 0.1);
}

.autocomplete-item .material-symbols-outlined {
    color: var(--gold);
    font-size: 20px;
}

.autocomplete-item-content {
    flex: 1;
}

.autocomplete-item-title {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.autocomplete-item-title strong {
    color: var(--gold-bright);
}

.autocomplete-item-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.autocomplete-loading,
.autocomplete-empty,
.autocomplete-error {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.autocomplete-error {
    color: var(--error);
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ============================================================
   Back to Top Button
   ============================================================ */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(180deg, #d4a840 0%, #b8892a 50%, #9a7020 100%);
    color: #1a1005;
    border: 3px solid var(--border-outer);
    border-radius: 50%;
    cursor: pointer;
    z-index: 9999;
    box-shadow: var(--shadow-lg), 0 0 20px rgba(201,165,74,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    outline: 2px solid var(--border-mid);
    outline-offset: -5px;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(201,165,74,0.5);
}

.back-to-top:active {
    transform: translateY(-1px);
}

.back-to-top .material-symbols-outlined {
    font-size: 24px;
}

/* ============================================================
   Breadcrumbs
/* ============================================================
   Empty States
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-panel);
    border: 3px solid var(--border-outer);
    border-radius: 6px;
    box-shadow: var(--shadow-md);
}

.empty-state .material-symbols-outlined {
    font-size: 5rem;
    color: var(--gold-dim);
    opacity: 0.4;
    margin-bottom: 1.5rem;
    display: block;
}

.empty-state h3 {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.5rem;
    color: var(--gold-bright);
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state button,
.empty-state a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================================
   Keyboard Shortcuts Modal
   ============================================================ */
.keyboard-shortcuts-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.keyboard-shortcuts-content {
    background: var(--bg-panel);
    border: 3px solid var(--border-outer);
    border-radius: 6px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.close-modal {
    background: transparent;
    border: 2px solid var(--border-outer);
    border-radius: 4px;
    padding: 0.3rem;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-modal:hover {
    background: rgba(201, 165, 74, 0.1);
    border-color: var(--gold);
    color: var(--gold-bright);
}

.close-modal .material-symbols-outlined {
    font-size: 20px;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-panel-inner);
    border: 2px solid var(--border-mid);
    border-radius: 4px;
}

.shortcut-item kbd {
    min-width: 40px;
    padding: 0.4rem 0.6rem;
    background: linear-gradient(180deg, #2a2218 0%, #1a1510 100%);
    border: 2px solid var(--border-outer);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gold-bright);
    text-align: center;
    box-shadow: var(--shadow-sm), inset 0 -2px 0 rgba(0,0,0,0.3);
}

.shortcut-item span {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================================
   Rate Limit Warning
   ============================================================ */
.rate-limit-warning {
    position: fixed;
    top: 5rem;
    right: 2rem;
    background: var(--bg-panel);
    border: 3px solid var(--warning);
    border-radius: 6px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
    z-index: 9998;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    max-width: 400px;
}

.rate-limit-warning.show {
    opacity: 1;
    transform: translateX(0);
}

.rate-limit-warning .material-symbols-outlined:first-child {
    color: var(--warning);
    font-size: 24px;
    flex-shrink: 0;
}

.rate-limit-warning span:nth-child(2) {
    flex: 1;
    color: var(--text-primary);
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.95rem;
}

.close-warning {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.close-warning:hover {
    color: var(--text-primary);
}

.close-warning .material-symbols-outlined {
    font-size: 20px;
}

/* ============================================================
   Toast Notifications
   ============================================================ */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-panel);
    border: 3px solid var(--border-outer);
    border-radius: 6px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    min-width: 300px;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

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

.toast.toast-success .material-symbols-outlined {
    color: var(--success);
}

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

.toast.toast-error .material-symbols-outlined {
    color: var(--error);
}

.toast .material-symbols-outlined {
    font-size: 24px;
    flex-shrink: 0;
}

.toast span:last-child {
    flex: 1;
    color: var(--text-primary);
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.95rem;
}

/* ============================================================
   Recently Viewed Section
   ============================================================ */
.recently-viewed {
    margin-bottom: 2rem;
}

.recently-viewed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.recently-viewed-item {
    background: var(--bg-panel);
    border: 2px solid var(--border-outer);
    border-radius: 4px;
    padding: 0.75rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.recently-viewed-item:hover {
    border-color: var(--gold);
    background: rgba(201, 165, 74, 0.05);
}

.recently-viewed-item .material-symbols-outlined {
    font-size: 2rem;
    color: var(--gold);
}

.recently-viewed-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.recently-viewed-name {
    font-family: 'Cinzel', Georgia, serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold-bright);
    line-height: 1.2;
    max-height: 2.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.recently-viewed-type {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================
   Export Button
   ============================================================ */
.export-dropdown {
    position: relative;
    display: inline-block;
}

.export-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-panel);
    border: 3px solid var(--border-outer);
    border-radius: 4px;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1000;
    display: none;
}

.export-menu.show {
    display: block;
}

.export-menu button {
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-inner);
    text-align: left;
    color: var(--text-primary);
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.export-menu button:last-child {
    border-bottom: none;
}

.export-menu button:hover {
    background: rgba(201, 165, 74, 0.1);
    color: var(--gold-bright);
}

.export-menu button .material-symbols-outlined {
    font-size: 18px;
}

/* ============================================================
   Responsive Adjustments
   ============================================================ */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }

    .rate-limit-warning {
        right: 1rem;
        left: 1rem;
        max-width: none;
    }

    .keyboard-shortcuts-modal {
        padding: 1rem;
    }

    .shortcuts-grid {
        grid-template-columns: 1fr;
    }

}
