/* === VARIABLES (SkateMU theme — matches the register portal palette) === */
:root {
    --primary: #e8c65a;
    --gold2: #a9781a;
    --purple: #9a6bff;
    --ember: #c8471f;
    --ink: #0a0507;
    --parch: #e9dcc4;
    --text: #e9dcc4;
}

/* === BASE === */
html {
    overflow-x: hidden;   /* belt-and-suspenders: no horizontal pan/zoom on mobile */
}

body {
    margin: 0;
    padding: 2rem 0;
    min-height: 100vh;
    box-sizing: border-box;
    overflow-x: hidden;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'EB Garamond', Georgia, serif;
    color: var(--text);
    background:
        radial-gradient(1200px 700px at 50% -12%, rgba(200, 71, 31, .28), transparent 62%),
        radial-gradient(900px 700px at 82% 8%, rgba(150, 90, 255, .16), transparent 60%),
        radial-gradient(1000px 800px at 12% 30%, rgba(120, 40, 10, .22), transparent 60%),
        linear-gradient(rgba(10, 5, 7, 0.82), rgba(10, 5, 7, 0.88)),
        url('mubg.jpg') no-repeat center center fixed;
    background-size: cover;
    background-color: var(--ink);
}

.stats-body {
    background:
        radial-gradient(1200px 700px at 50% -12%, rgba(200, 71, 31, .28), transparent 62%),
        radial-gradient(900px 700px at 82% 8%, rgba(150, 90, 255, .16), transparent 60%),
        linear-gradient(rgba(10, 5, 7, 0.82), rgba(10, 5, 7, 0.88)),
        url('mubg.jpg') no-repeat center center fixed;
    background-size: cover;
}

/* === LANGUAGE SWITCHER === */
.lang-switch {
    text-align: right;
    font-size: 0.7rem;
    margin-bottom: -10px;
    font-weight: bold;
}

.lang-switch span {
    cursor: pointer;
    color: #666;
    transition: 0.3s;
    padding: 0 5px;
}

.lang-switch span.active {
    color: var(--primary);
}

/* === CONTAINER === */
.container {
    background: linear-gradient(180deg, rgba(28, 18, 12, .92), rgba(14, 9, 8, .95));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(246, 226, 122, .12);
    width: 100%;
    max-width: 400px;
    border: 1px solid #6a4e1f;
    border-top: 4px solid var(--primary);
}

.stats-body .container {
    max-width: 800px;
}

/* === HEADINGS === */
h2 {
    text-align: center;
    font-family: 'Cinzel', serif;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 2rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 0 18px rgba(200, 71, 31, .4);
}

/* === FORMS === */
.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: #aaa;
    text-transform: uppercase;
}

input {
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 6px;
    transition: 0.3s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.7);
}

/* === BUTTONS === */
button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(180deg, #f6e27a, var(--primary) 48%, var(--gold2));
    border: 1px solid #6a4e1f;
    color: #2a1704;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    letter-spacing: 1.5px;
    cursor: pointer;
    border-radius: 6px;
    text-transform: uppercase;
    transition: 0.3s;
    margin-top: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .4);
}

button:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

/* === MESSAGES === */
#message {
    margin-top: 1.5rem;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    display: none;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
}

.success {
    background: rgba(39, 174, 96, 0.2);
    color: #2ecc71;
    border: 1px solid #2ecc71;
}

.error {
    background: rgba(192, 57, 43, 0.2);
    color: #e74c3c;
    border: 1px solid #e74c3c;
}

/* === WARNING BOX === */
.warning-box {
    background: rgba(212, 175, 55, 0.1);
    border-left: 3px solid var(--primary);
    padding: 10px;
    font-size: 0.75rem;
    margin-top: 10px;
    color: #d4af37;
}

/* === LOADER SPINNER === */
.spinner-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 3px solid #000;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === FOOTER NAV === */
.footer-nav {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.nav-link {
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 20px;
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.nav-link:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.2);
}

.nav-link:active {
    transform: translateY(0);
}

/* === CREDITS === */
.credits {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    width: 100%;
    text-align: center;
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.credits a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.4s ease;
    font-weight: 400;
}

.credits a span {
    font-weight: 300;
}

.credits a:hover {
    color: var(--primary);
    opacity: 1;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* === RANKING TABLE === */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th {
    text-align: left;
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

td {
    padding: 15px;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.master-level {
    text-align: center;
}

td.master-level {
    color: #8b0000;
    font-weight: bold;
}

tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.char-name {
    font-weight: bold;
    color: #fff;
}

.rank-number {
    color: var(--primary);
    font-weight: bold;
    width: 30px;
}

.reset-badge {
    background: rgba(212, 175, 55, 0.15);
    color: var(--primary);
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 10px;
    display: inline-block;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:nth-child(1) .char-name {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* characters who reached the server reset cap (muConfig.maxResets) get a glowing
   reset badge — rank #1 is marked separately by its gold character name */
.reset-badge.max-reset {
    background: rgba(255, 215, 0, 0.25);
    border-color: #ffd700;
    color: #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.45);
}

.table-loader {
    text-align: center;
    padding: 20px;
    color: var(--primary);
}

/* === SERVER STATUS === */
.server-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: -10px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: #aaa;
}

.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #666;
    display: inline-block;
    flex-shrink: 0;
    transition: background 0.3s;
}

#statusText {
    line-height: 1;
}

.status-dot.online {
    background: #2ecc71;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.6);
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: #e74c3c;
    box-shadow: 0 0 8px rgba(231, 76, 60, 0.6);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* === ARMORY === */
.armory-body {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('mubg.jpg') no-repeat center center fixed;
    background-size: cover;
}

.armory-body .container {
    max-width: 860px;
}

.armory-search {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 1.8rem;
}

.armory-search input {
    flex: 1 1 auto;
    width: auto;          /* override global "input { width: 100% }" */
    min-width: 0;         /* allow the flex item to shrink properly */
    max-width: 300px;
    padding: 0.7rem 1rem;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text);
    font-size: 1rem;
}

.armory-search input:focus {
    outline: none;
    border-color: var(--primary);
}

.armory-search button {
    flex: 0 0 auto;       /* keep the button at its content size */
    width: auto;          /* override global "button { width: 100% }" */
    margin-top: 0;        /* override global "button { margin-top: 1rem }" */
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: #1a1a1a;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    cursor: pointer;
    transition: filter 0.2s;
}

.armory-search button:hover {
    filter: brightness(1.1);
}

.armory-content {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

/* Left: character panel */
.armory-char {
    flex: 0 0 240px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.armory-char-image {
    width: 100%;
    max-width: 200px;
    height: auto;
    opacity: 0.9;
}

.armory-char-name {
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: bold;
    margin-top: 0.5rem;
}

.armory-char-class {
    color: #aaa;
    font-style: italic;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

.armory-char-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9rem;
    color: var(--text);
}

.armory-char-stats b {
    color: #fff;
}

/* Right: equipment paper doll */
.armory-equip {
    flex: 1;
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.armory-doll {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
}

.armory-slot {
    position: relative;
    aspect-ratio: 1 / 1;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.armory-slot.filled {
    border-color: rgba(212, 175, 55, 0.4);
    background: rgba(212, 175, 55, 0.08);
    cursor: help;
}

.armory-slot img {
    max-width: 86%;
    max-height: 86%;
    object-fit: contain;
    image-rendering: pixelated;
}

.armory-slot img.img-missing {
    visibility: hidden;
}

.armory-slot .slot-label {
    color: #555;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.armory-slot .badge {
    position: absolute;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 4px;
    line-height: 1.2;
}

.armory-slot .badge.exc { top: 3px; left: 3px; background: rgba(46, 204, 113, 0.85); color: #07210f; }
.armory-slot .badge.anc { top: 3px; right: 3px; background: rgba(255, 215, 0, 0.9); color: #2a2100; }
.armory-slot .badge.sock { bottom: 3px; right: 3px; background: rgba(155, 89, 182, 0.9); color: #fff; }

.armory-message {
    text-align: center;
    color: #aaa;
    padding: 1rem;
}

.armory-message.error {
    color: #e74c3c;
}

/* Themed item tooltip */
.item-tooltip {
    display: none;
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    max-width: 320px;
    padding: 10px 13px;
    background: rgba(15, 15, 15, 0.95);
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-top: 3px solid var(--primary);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 0.8rem;
    line-height: 1.55;
    color: #cfcfcf;
}

.item-tooltip .tip-head {
    color: var(--primary);
    font-weight: bold;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.item-tooltip .tip-line.opt { color: #4aa3ff; }   /* normal options & luck - blue */
.item-tooltip .tip-line.exc { color: #2ecc71; }   /* excellent options - green */
.item-tooltip .tip-line.skill { color: #ffffff; } /* skill - white */
.item-tooltip .tip-line.sock { color: #b18bd8; }  /* sockets - purple */

/* armory paper-doll stacks earlier (640px) than the global phone breakpoint */
@media (max-width: 640px) {
    .armory-content {
        flex-direction: column;
    }
    .armory-char {
        flex: none;
        width: 100%;
        box-sizing: border-box;
    }
}

/* === MOBILE (phones) === */
@media (max-width: 480px) {
    body {
        padding: 1rem 0.75rem;   /* horizontal breathing room, stop edge-clipping */
    }

    .container {
        padding: 1.5rem;         /* tighter than the 2.5rem desktop padding */
    }

    h2 {
        font-size: 1.3rem;
        letter-spacing: 1px;
        margin-bottom: 1.5rem;
        word-break: break-word;
    }

    .footer-nav {
        gap: 10px;
        margin-top: 1.8rem;
        padding-top: 1.5rem;
    }

    .nav-link {
        padding: 8px 14px;
        font-size: 0.78rem;
    }

    /* ranking table: fit 5 columns on a narrow screen */
    th,
    td {
        padding: 8px 6px;
        font-size: 0.82rem;
    }

    .reset-badge {
        margin-left: 6px;
        padding: 1px 5px;
        font-size: 0.65rem;
    }
}

/* ============================================================
   SkateMU theme overrides (appended — keep at end of file)
   Matches the register-portal look: Cinzel headings, gold/ember
   palette, ornamented panels.
   ============================================================ */
label {
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
    color: #a98f5f;
}

input {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1rem;
    border-color: #4a3a18;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(232, 198, 90, .25);
}

.nav-link {
    font-family: 'Cinzel', serif;
    font-size: 0.71rem;
    letter-spacing: 1.5px;
    color: #cbb78a;
    background: rgba(40, 28, 16, .5);
    border: 1px solid #4a3a18;
    border-radius: 4px;
}

.nav-link:hover {
    background: rgba(200, 71, 31, .12);
    border-color: #6a4e1f;
    color: #fff2cf;
    text-shadow: 0 0 8px rgba(232, 198, 90, .6);
    box-shadow: 0 5px 15px rgba(200, 71, 31, .2);
}

.footer-nav {
    border-top: 1px solid rgba(106, 78, 31, .55);
}

.warning-box {
    background: rgba(232, 198, 90, 0.08);
    border-left: 3px solid var(--primary);
    color: #d9c390;
}

.lang-switch span.active {
    color: var(--primary);
    text-shadow: 0 0 8px rgba(232, 198, 90, .5);
}

th {
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
    color: #d9c390;
}

.credits a, .credits span {
    color: #8f7c55;
}

/* ===== SkateMU: Buscador de Items ===== */
.items-sub { color: var(--text); opacity: .8; margin: -.3rem 0 1rem; }
.items-search { display: flex; gap: .5rem; margin-bottom: 1.2rem; }
.items-search input {
    flex: 1; padding: .6rem .8rem; background: rgba(10,5,7,.6);
    border: 1px solid #6a4e1f; color: var(--text); border-radius: 4px; font-size: 1rem;
}
.items-content { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 720px) { .items-content { grid-template-columns: 1fr; } }
.items-list, .items-detail {
    background: rgba(10,5,7,.45); border: 1px solid #6a4e1f; border-radius: 6px;
    padding: .6rem; min-height: 120px; max-height: 60vh; overflow-y: auto;
}
.items-message { color: var(--text); opacity: .7; padding: .8rem; text-align: center; }
.item-row {
    display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left;
    padding: .4rem .5rem; background: transparent; border: 0; border-bottom: 1px solid rgba(106,78,31,.35);
    color: var(--text); cursor: pointer; font-size: .95rem;
}
.item-row:hover { background: rgba(232,198,90,.12); }
.item-icon { width: 28px; height: 28px; object-fit: contain; flex: none; }
.item-icon-lg { width: 48px; height: 48px; object-fit: contain; }
.item-name { flex: 1; }
.item-gn { color: var(--gold2); font-size: .8rem; opacity: .8; }
.item-detail-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.item-detail-head h3 { margin: 0; color: var(--primary); }
.items-detail h4 { color: var(--primary); margin: .8rem 0 .4rem; border-bottom: 1px solid rgba(106,78,31,.4); padding-bottom: .2rem; }
.drop-list, .shop-list { list-style: none; margin: 0; padding: 0; }
.drop-list li { padding: .5rem 0; border-bottom: 1px solid rgba(106,78,31,.25); }
.shop-list li { padding: .3rem 0; }
.drop-grp { color: var(--parch); font-weight: 600; }
.drop-chance { color: #2ecc71; font-weight: 700; }
.drop-src { display: block; font-size: .85rem; opacity: .85; margin-top: .2rem; }
