@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #121822;              /* Fondo de página SUPER oscuro (casi negro) */
    --fg: #0d131f;              /* Menú lateral y cabecera */
    --lighterfg: #151e2f;       /* Fondo de las tarjetas (destaca sobre el bg) */
    --lightererfg: #1e2a40;     /* Hover de las tarjetas */
    --lightestfg: #334155;      /* Inputs y líneas separadoras */
    
    --polarisgreen: #43dada;    /* Mantenemos tu verde neón característico */
    --colon: #30a596;           /* Un acento */
    
    --emojigreen: #10b981;      /* Verde más suave para botones de éxito */
    --emojired: #ff6b6b;        /* Rojo moderno para borrar/alertas */
    --emojiblue: #3b82f6;       /* Azul vibrante para información */
    --emojipurple: #8b5cf6;     /* Púrpura eléctrico para acciones especiales */

    --defaultrolecol: #94a3b8;  /* Gris azulado para texto secundario o roles sin color */
    --sliderwidth: 60px;
    --sliderheight: 32px;
    --sliderpadding: 4px;
}

html, body {
    height: 100%;
}

body {
    background-color: var(--bg);
    color: white;
    margin: 0px;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

p, h1, h2, button {
    font-family: var(--lato);
    color: white;
}

p {
    font-size: 18px;
    margin: 12px 0px;
    line-height: 28px;
}

h1, h2 {
    font-family: var(--opensans);
    font-weight: 800;
    font-size: 36px;
    margin-top: 5px;
    margin-bottom: 5px;
}

h2 {
    margin-top: 26px;
    margin-bottom: 3px;
    font-size: 22px;
}

a {
    color: aqua !important;
}

input, select, textarea {
    font-family: var(--lato);
    background-color: var(--evenlighterfg);
    border: 1px solid var(--lightestfg);
    border-radius: 4px;
    height: 40px;
    font-size: 18px;
    padding-left: 10px;
    color: white;
    width: 350px;
}

input[type="number"] {
    width: 125px;
}

input::placeholder, textarea::placeholder {
    color: white;
    opacity: 50%;
}

input[disabled] {
    cursor: not-allowed;
    background-color: var(--waylighterfg);
}

.lineinput {
    border: none;
    background: none;
    border-bottom: 1px solid white;
    border-bottom-left-radius: 0px;
    border-bottom-right-radius: 0px;
    padding: 0px 0px;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.2);
}

select option:disabled {
    color: #999999;
}

select option {
    background-color: var(--bg);
}

button {
    font-family: 'Inter', sans-serif !important; 
    font-size: 16px !important; 
    font-weight: 600 !important;
    color: white;
    background-color: var(--emojiblue);
    
    height: auto !important; 
    width: auto !important; 
    min-width: 140px;
    
    /* Le damos respiro y lo redondeamos como las tarjetas */
    padding: 10px 24px !important; 
    border: none;
    border-radius: 8px !important; 
    cursor: pointer;
    
    display: inline-flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap; 
    
    transition: all 0.2s ease;
}

button:hover, button:focus-visible { 
    transform: translateY(-2px); 
    filter: brightness(115%);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25); 
    outline: none;
}

button:active { 
    transform: translateY(0px); 
    filter: brightness(125%);
}

button:disabled {
    cursor: not-allowed;
    opacity: 50%;
    filter: saturate(50%);
    transform: none;
    box-shadow: none;
}

.fancybutton {
    font-family: var(--opensans);
    background-color: rgba(0, 0, 0, 0);
    border: 2px solid var(--polarisgreen);
    transition-duration: 0.25s;
    height: 50px;
    min-width: 140px;
    padding: 5px 20px;
}

.fancybutton:hover, .fancybutton:focus-visible {
    background-color: var(--polarisgreen);
    color: black;
}

.boringbutton {
    font-family: var(--opensans);
    background-color: rgba(0, 0, 0, 0);
    border: none;
    font-weight: 400;
    opacity: 66%;
}

.boringbutton:hover, .boringbutton:focus-visible {
    opacity: 100%;
}

textarea {
    width: 600px;
    height: 200px;
    padding-top: 8px;
    max-width: 100%;
    max-height: 700px;
}

.codeArea {
    font-family: monospace;
    font-size: 16px;
}

.colInputPreview {
    height: 40px;
    width: 40px;
    border: 1px solid black;
    border-radius: 4px;
    background-color: var(--polarisgreen);
    cursor: pointer;
}

.hiddenColInput {
    width: 0px;
    margin: 0px 0px;
    padding: 0px 0px;
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.canfocus:focus-visible, input:focus, button:focus-visible, textarea:focus, select:focus, input[type=range]:focus-visible,
[contenteditable]:focus, #sidebar .category:focus-visible, .flexTable div p:focus-visible, .colInputPreview:focus-visible,
.leaderboardSlot.canManage:focus-visible {
    outline: 2px solid var(--colon);
}

.slider {
    position: relative;
    display: inline-block;
    width: var(--sliderwidth);
    height: var(--sliderheight);
}

.slider:has(> input:disabled) {
    opacity: 33%;
}

.slider input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider:focus-within {
    outline: 2.5px solid white;
    border-radius: 420px;
}

.popup {
    position: fixed; 
    display: none; 
    width: 100%;
    height: 100%;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.66);
    z-index: 2;
    text-align: center;
}

.popupbox {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popupbox .box {
    width: 650px;
}

.popupConfirm {
    font-size: 22px;
    height: 50px;
    width: 150px;
    margin: 20px 7px 0px 7px;
}

.sliderspan {
    position: absolute;
    cursor: pointer;
    margin: 0px 0px !important;
    top: 0; left: 0; right: 0; bottom: 0; 
    background-color: #aaaaaa;
    transition-duration: 0.25s;
    transition-timing-function: ease-in-out;
    border-radius: 420px;
}
  
.sliderspan:before {
    position: absolute;
    content: "";
    height: calc(var(--sliderheight) - var(--sliderpadding) );
    width: calc(var(--sliderheight) - var(--sliderpadding) );
    left: var(--sliderpadding);
    bottom: calc(var(--sliderpadding) * 0.5);
    background-color: white;
    transition-duration: 0.25s;
    transition-timing-function: ease-in-out;
    border-radius: 420px;
}
  
input:checked + .sliderspan {
    background-color: var(--colon);
}
  
input:checked + .sliderspan:before {
    transform: translateX(calc(var(--sliderwidth) - var(--sliderheight) - (var(--sliderpadding))));
}

.box {
    box-sizing: border-box;
    border: 2px solid transparent; 
    border-radius: 12px; 
    padding: 15px 20px 25px 20px; 
    margin: 15px auto;
    display: block; 
    
    background-image: linear-gradient(var(--lighterfg), var(--lighterfg)), 
                      linear-gradient(135deg, var(--polarisgreen), var(--colon));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-image 0.2s ease;
}

.details {
    font-size: 16px;
    opacity: 70%;
    margin-bottom: 5px;
    margin-top: 0px;
}

.settingBox, .sideoption {
    width: calc(100% - 30px) !important; 
    max-width: 1000px !important;
    height: auto !important; 
    margin-left: auto !important;
    margin-right: auto !important;
}

.box p, .box span, .multiplierDescription {
    height: auto !important;
    min-height: 0 !important;
}

.settingBox h2:first-child {
    margin-top: 12px;
}

.categoryBox {
    cursor: pointer;
    width: 379px;
    height: 150px;
    padding: 10px 20px;
    transition-duration: 0.1s;
}

.categoryBox img, .categoryBox svg {
    height: 50px !important;
    width: 50px !important;
    margin-right: 18px;
    flex-shrink: 0;
    color: var(--polarisgreen);
}

.categoryBox h2 {
    margin-top: 6px !important;
}

.categoryBox:hover, .categoryBox:focus-visible {
    background-image: linear-gradient(var(--lightererfg), var(--lightererfg)), 
                      linear-gradient(135deg, var(--polarisgreen), var(--colon));
    
    transform: translateY(-4px); 
    
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 255, 128, 0.15); 
}

.categoryBox h2 {
    margin-top: 6px !important;
}

.categoryBox {
    cursor: pointer;
    width: calc(50% - 30px);
    min-width: 400px;
    height: 150px;
    padding: 10px 20px;
    transition-duration: 0.2s;
}

.fulllength {
    width: calc(100% - 30px);
    max-width: 1500px;
}

.settingBreak {
    width: 100%;
}

.centerflex {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
}

.simpleflex {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap; 
    gap: 20px;
}

.middleflex {
    display: flex;
    justify-content: center;
    align-items: center
}

.spacedflex {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.spacedflex * {
    margin-right: 0px !important; 
}
.field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

.bottomBar {
    position: relative !important; 
    bottom: auto !important;
    left: auto !important;
    display: flex;
    align-items: center;
    margin-top: 15px !important; /* Un respiro con el texto de arriba */
}

.multiplierDescription {
    opacity: 100%;
    margin-top: 10px;
    height: auto !important; 
    width: 100% !important; 
    max-width: 100%; 
    line-height: 1.5;
}

#header {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    background-color: var(--fg);
    height: 50px;
    border-bottom: 1px solid black;
    z-index: 1;
    overflow: hidden;
}

#header div {
    display: flex;
    align-items: center;
    height: 100%;
    margin: 0px 25px;
    cursor: pointer;
}

#header div:focus-visible {
    outline: none;
}

#header h2 {
    margin: 0px 0px;
    font-size: 18px;
    font-weight: 700;
    transition-duration: 0.1s;
}

#header div:hover h2, #header div:focus-visible h2 {
    color: var(--polarisgreen);
}

#header div:focus-visible h2 {
    text-decoration: underline;
}

#header img {
    height: 70%;
    width: 36px;
    margin-right: 12px;
}

#header a {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    width: 100%;
    height: 100%;
}

#sidebar {
    position: fixed;
    display: flex;
    flex-direction: column;
    width: 265px; 
    height: 100%;
    background-color: var(--fg);
    border-right: 1px solid var(--lightestfg);
    overflow: hidden;
    white-space: nowrap;
    z-index: 10;
}

#sidebar div {
    height: 70px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding-left: 15px;
    cursor: pointer;
    color: var(--defaultrolecol); /* Color gris apagado por defecto */
    border-left: 4px solid transparent; /* Preparamos el borde */
    transition: all 0.2s ease;
}

#sidebar div:focus-visible, #sidebar div:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

#sidebar div:hover {
    background-color: var(--evenlighterfg) !important;
}

#sidebar div.current {
    color: var(--colon);
    font-weight: bold;
    background-color: var(--lighterfg);
}

#sidebar div img, #sidebar div svg {
    width: 32px;
    height: 32px;
    margin-right: 16px;
    color: var(--defaultrolecol); /* Icono apagado por defecto */
    transition: all 0.2s ease;
}

#sidebar div.current {
    color: var(--polarisgreen);
    font-weight: bold;
    background-color: rgba(67, 218, 218, 0.1) !important; /* Fondo verde sutil */
    border-left: 4px solid var(--polarisgreen); /* Línea indicadora a la izquierda */
}

#sidebar div.current svg {
    color: var(--polarisgreen); /* Encendemos el icono */
}

#unsavedWarning {
    position: fixed;
    display: flex;
    pointer-events: none;
    justify-content: center;
    z-index: 2;
    width: 100%;
    height: 50px;
    bottom: 10px;
    transition-duration: 0.25s;
    transition-timing-function: ease-in-out;
    transition-property: transform;
    transform: translateY(60px);
}

#unsavedWarning.activeWarning {
    transform: translateY(0px);
    pointer-events: all;
}

.unsavedBox {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 300px;
    border: 1px solid black;
    border-radius: 8px;
    background-color: var(--fg);
    padding: 0px 20px;
}

.unsavedBox button {
    height: 34px;
    width: 69px;
}

.configboxes {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    padding-bottom: 20px;
    margin-left: 280px; 
    max-width: 1260px;
}

.sideoption {
    width: 600px;
}

.optionRow {
    margin-bottom: 16px;
}

.curvefield p {
    margin-left: 4px;
    margin-right: 15px;
}

.desmos {
    width: 100%; 
    max-width: 1000px;
    height: 500px;
    border-radius: 8px; 
    border: 1px solid var(--lightestfg); 
    overflow: hidden;
}

.flexTable {
    overflow-y: auto;
    overflow-x: auto; /* Permite scroll horizontal en la tabla si es muy ancha en móvil */
    width: 100%; /* Que ocupe todo el ancho posible de su contenedor */
    max-width: 800px; /* Un tamaño máximo para que no se estire de más en PC */
    max-height: 750px;
    display: flex; /* Mantiene las columnas unidas */
    flex-wrap: nowrap !important; /* PROHÍBE que las columnas salten hacia abajo */
}

.flexTable div p {
    padding: 7px 50px 7px 10px;
    margin: 0px 0px;
    border: 1px solid black;
    background-color: var(--lighterfg);
    white-space: nowrap;
    overflow: hidden;
}

.flexTable div p:nth-child(2n) {
    background-color: var(--lightererfg);
}

.longname {
    text-overflow: ellipsis;
    overflow: hidden;
}

.deleteRow {
    text-align: center;
    padding-left: 0px !important;
    padding-right: 0px !important;
    cursor: pointer;
}

#rewards div p:hover:not(:first-child) { background-color: var(--waylighterfg); }

.deleteRow:hover { background-color: var(--emojired) !important }

.toggleRow:hover {
    cursor: pointer;
    background-color: var(--emojiblue) !important;
}

.varList select {
    width: 120px;
    margin-right: 10px;
}

.serverOption {
    height: 90px;
    display: flex;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    width: 80%;
    max-width: 850px;
    min-width: 500px;
    background-color: var(--lighterfg);
    border: 1px solid black;
    border-radius: 8px;
    margin: 0px auto 3px auto;
    padding: 0px 10px;
    overflow: hidden;
    cursor: pointer;
    transition-duration: 0.1s;
}

.serverOption:hover, .serverOption:focus-visible {
    background-color: var(--lightererfg);
}

.serverOption img[sv=icon] {
    height: 65px;
    border-radius: 420px;
    margin-left: 10px;
    margin-right: 20px;
}

.serverOption p {
    margin: 4px 0px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 600px;
}

.serverOption .serverIcons svg {
    cursor: pointer;
    width: 28px;
    height: 28px;
    color: white; /* Color base */
    transition: color 0.1s;
}

.serverOption .serverIcons a {
    transition-duration: 0.1s;
    border-radius: 5px;
    padding: 8px; /* Un poco más de área para hacer clic */
    margin: 0 2px;
    display: none;
}

.serverOption .serverIcons a:hover svg, .serverOption .serverIcons a:focus-visible svg {
    color: var(--polarisgreen); /* Se pintan de verde al pasar el ratón */
}

.serverBreak {
    height: 30px;
}

.leaderboardBox {
    width: 90%;
    min-width: 500px;
    max-width: 1500px;
    background-color: var(--lighterfg);
    border: 1px solid black;
    border-radius: 8px;
    margin: auto;
    display: flex;
    flex-direction: column;
    padding: 0px 10px;
}

.leaderboardSlot {
    height: 100px;
    width: 100%;
    border-radius: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.leaderboardSlot .mainInfo {
    display: flex;
    align-items: center;
    overflow: hidden;
}

.leaderboardSlot:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.leaderboardSlot.canManage {
    cursor: pointer;
    transition-duration: 0.1s;
    transition-property: background-color;
}

.leaderboardSlot.isSelf {
    background-color: rgba(255, 255, 255, 0.2);
}

.leaderboardSlot.canManage:hover, .leaderboardSlot.canManage:focus-visible {
    background-color: rgba(255, 255, 255, 0.15);
}

.hideFromLeaderboard:hover {
    color: yellow !important;
    opacity: 100% !important;
    font-weight: bold !important;
}

.highlightedSlot {
    background-color: rgba(255, 255, 255, 0.25);
    border-bottom: none !important;
}

.plsLogIn {
    display: none;
    text-align: center;
    margin-bottom: 20px;
    color: aqua;
}

.leaderboardSlot p {
    font-size: 20px;
    margin: 4px 0px;
    white-space: nowrap;
}

.leaderboardSlot h2[lb=rank] {
    margin: 0px 0px;
    width: 200px;
    text-align: center;
    width: 60px;
}

.leaderboardSlot.notInServer .generalInfo p {
    text-decoration: line-through;
    font-weight: normal !important;
    opacity: 66%;
}

.progressBar {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.33);
    border-radius: 16px;
    height: 60px;
    overflow: hidden;
    position: relative;
}

.progressBar .progress {
    height: 100%;
}

.progressBar .xpOverlay {
    position: absolute;
    display: flex;
    justify-content: center;
    flex-direction: column;
    margin: 0px 0px;
    padding-left: 12px;
    height: 100%;
    top: 0px;
    width: 100%;
}

.progressBar .xpOverlay p {
    line-height: 25px;
    margin: 0px 0px;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0.5px 0.5px 3px black, 0.5px 0.5px 3px black;
    white-space: nowrap;
}

.progressBar .xpOverlay .editIcon {
    position: absolute;
    right: 30px;
    height: 30px;
    filter: drop-shadow(0.5px 0.5px 3px black);
    display: none;
}

.leaderboardSlot p[lb=multiplier] {
    font-size: 15px;
}

.accountBox p {
    font-size: 22px;
}

.accountBox img[lb=pfp] {
    border-radius: 420px;
    height: 100px;
    margin-right: 25px;
}

.statBox {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    max-width: 400px;
}

.statBox p {
    font-weight: bold;
    margin: 0px 0px;
}

.statBox p[lb] {
    font-weight: normal;
    margin: 7px 0px 40px 0px;
}

.emptyLbBox {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 90%;
    min-width: 500px;
    max-width: 1500px;
    margin: auto;
}

.hiddenMemberSlot {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--lighterfg);
    border: 1px solid black;
    text-align: center;
    border-radius: 5px;
    width: 275px;
    height: 140px;
    overflow: hidden;
    margin: 10px 10px;
}

.hiddenMemberSlot p[lb="unhide"] {
    width: fit-content;
    margin: auto;
    padding: 5px 20px;
    font-size: 20px;
    font-weight: bold;
    color: var(--polarisgreen);
    cursor: pointer;
    text-decoration: underline; 
}

#lbButtons button {
    margin: 0px 10px;
    width: 170px;
    background-color: var(--emojiblue);
}

#lbButtons button:not(.selectedlb) {
    background-color: #20384b;
}

#uhoh #errorhelp {
    display: none;
    opacity: 50%;
    font-size: 16px;
    margin-top: 0px
}

#uhoh #loginbutton {
    display: none;
    background-color: var(--emojipurple);
    margin-top: 5p
}

.coolthing {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    margin-top: 30px;
    margin-bottom: 50px;
}

.coolthing div {
    width: 450px;
    padding: 0px 50px;
    margin: 0px 20px;
}

.coolthing .coolimage img {
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    width: 450px;
    transition-duration: 0.2s;
    transition-timing-function: ease-in-out;
}

.coolthing .coolimage img:hover {
    transform: scale(1.2);
}

.coolthing .cooltext {
    min-width: 350px;
}

.coolthing .cooltext p {
    opacity: 75%;
}

.red { color: #fca5a5 !important;}

/* 1. Domamos el contenedor para que no aplaste el texto */
.serverOption .serverIcons {
    width: auto !important;
    flex-grow: 1 !important; 
    justify-content: flex-end !important;
}

/* 2. Le damos a los botones un tamaño estricto tipo "caja" */
.serverOption .serverIcons a {
    width: 38px !important; 
    height: 38px !important; 
    border-radius: 8px !important;
    text-align: center !important;
    line-height: 44px !important; /* Centra el icono verticalmente */
    margin: 0 4px !important;
    padding: 0 !important; /* Matamos los paddings que lo deformaban */
}

/* 3. ¡LA CURA! Bloqueamos el tamaño del SVG para que jamás vuelva a crecer */
.serverOption .serverIcons svg {
    width: 24px !important; 
    height: 24px !important;
    vertical-align: middle !important;
    flex-shrink: 0 !important;
    color: white;
    transition: color 0.1s;
}

/* 4. Efecto hover brillante */
.serverOption .serverIcons a:hover svg, .serverOption .serverIcons a:focus-visible svg {
    color: var(--polarisgreen) !important; 
}

@media screen and (max-width: 900px) {
    body, html {
        overflow-x: hidden; /* Prohíbe terminantemente el scroll horizontal */
    }

    #everything {
        width: 100% !important; /* Fuerza a que el contenedor maestro respete la pantalla */
    }
    /* 1. EL MENÚ LATERAL (#sidebar) */
    /* Lo pasamos de la izquierda a la parte inferior de la pantalla (como una app) */
    #sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 65px; /* Altura de la barra inferior */
        flex-direction: row; /* Elementos uno al lado del otro */
        overflow-x: auto; /* Permite hacer scroll horizontal si hay muchos iconos */
        overflow-y: hidden;
        border-right: none;
        border-top: 1px solid var(--lightestfg);
        z-index: 100;
    }

    #sidebar div {
        height: 100%;
        min-width: 65px; /* Tamaño mínimo para cada botón del menú */
        justify-content: center; /* Centrar iconos */
        padding-left: 0;
        flex: 1; /* Repartir el espacio equitativamente */
    }

    #sidebar div img, #sidebar div svg {
        margin-right: 0; 
        width: 24px; 
        height: 24px;
    }

    /* Ocultamos el texto del menú en móvil para ahorrar espacio */
    #sidebar p { 
        display: none; 
    }

    /* 2. EL CONTENEDOR PRINCIPAL (.configboxes) */
    /* Le quitamos el margen izquierdo porque el menú ya no está ahí */
    .configboxes {
        margin-left: 0px; 
        padding-bottom: 80px; /* Espacio extra abajo para que el nuevo menú inferior no tape contenido */
        justify-content: center; /* Centramos las tarjetas */
    }

    /* 3. LAS TARJETAS (Cajas y opciones) */
    .box, .categoryBox, .fulllength, .sideoption, .settingBox, .sideoptions, .serverOption, .leaderboardBox {
        width: calc(100% - 30px) !important;
        min-width: 0 !important; 
        margin: 15px auto !important; /* Margen perfecto y centrado automático */
        box-sizing: border-box;
    }

    /* 4. ELEMENTOS FLEXIBLES (.simpleflex, .centerflex, etc.) */
    /* Apilamos elementos que antes estaban lado a lado */
    .simpleflex, .spacedflex {
        flex-direction: column !important; /* Apilar verticalmente */
        align-items: stretch !important; /* Estirar para ocupar el ancho */
    }

    .spacedflex * {
        margin-right: 0px;
        margin-bottom: 10px; /* Separación vertical en lugar de horizontal */
    }

    /* 5. INPUTS Y TEXTAREAS */
    /* Adaptar anchos fijos de inputs para que no se salgan de la pantalla */
    input, select, textarea {
        width: 100% !important;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* 6. TABLAS (.flexTable) */
    .flexTable {
        width: 100% !important;
        overflow-x: auto !important;
        display: flex !important; 
        
        /* ⬇️ LA MAGIA QUE VENCE AL SIMPLEFLEX ⬇️ */
        flex-direction: row !important; 
        flex-wrap: nowrap !important; 
        
        -webkit-overflow-scrolling: touch; 
        padding-bottom: 15px; 
    }

    /* Evita que Flexbox aplaste las columnas para intentar meterlas en la pantalla */
    .flexTable > div {
        flex-shrink: 0 !important; 
    }

    /* 7. POPUPS */
    .popupbox .box {
        width: 90%; /* Popups más estrechos en móvil */
    }
    /* ========================================= */
    /* 8. CABECERA DEL SERVIDOR (Página Inicio)  */
    /* ========================================= */
    
    #serverInfo .fulllength:first-child {
        display: flex;
        flex-direction: column; /* Apila el contenido verticalmente */
        align-items: center;
        text-align: center;
        padding-top: 25px !important;
    }

    /* Centramos el icono y el texto del servidor */
    #serverInfo .fulllength:first-child .centerflex {
        flex-direction: column; 
        margin-bottom: 20px;
    }

    #serverInfo .fulllength:first-child .centerflex div {
        margin-left: 0 !important; /* Quitamos el margen lateral del texto */
        margin-top: 10px;
    }

    /* Domamos el contenedor de los botones (matamos el absolute) */
    #serverInfo .fulllength:first-child .middleflex {
        position: relative !important; 
        top: auto !important;
        right: auto !important;
        height: auto !important;
        flex-direction: column; /* Botones uno debajo del otro */
        gap: 15px; /* Separación elegante entre botones */
        width: 100%;
    }

    /* Hacemos que los botones ocupen todo el ancho para que sean fáciles de tocar */
    #serverInfo .fulllength:first-child .middleflex a {
        width: 100%;
    }

    #serverInfo .fulllength:first-child .middleflex button {
        margin-right: 0 !important; 
        width: 100% !important; 
    }
    /* ========================================= */
    /* 9. FÓRMULA DE LA CURVA (Excepción)        */
    /* ========================================= */
    
    .curvefield {
        display: flex !important;
        flex-direction: row !important; /* Mantenemos todo en línea horizontal */
        flex-wrap: wrap !important; /* Permitimos que baje de línea si la pantalla es enana */
        justify-content: center;
        align-items: center;
        width: 100%;
        gap: 5px; /* Separación inteligente */
    }

    /* Salvamos a los inputs de la curva del 100% de ancho */
    .curvefield input {
        width: 55px !important; /* Cajitas más pequeñas para móvil */
        height: 35px !important;
        font-size: 14px !important; /* Letra más pequeña */
        padding: 0px 5px !important;
        text-align: center;
    }

    /* Ajustamos los textos de x³, x², etc. */
    .curvefield p {
        font-size: 14px !important; 
        margin: 0px !important; /* Matamos los márgenes gigantes originales */
    }
    /* ========================================= */
    /* 10. PESTAÑA ACTIVA EN MÓVIL (UX)          */
    /* ========================================= */
    
    #sidebar div.current {
        border-left: none !important; /* Quitamos la línea lateral */
        border-top: 3px solid var(--polarisgreen) !important; /* Ponemos la línea arriba */
    }
    /* ========================================= */
    /* 11. DOMAR CONTENEDORES CON ANCHO FIJO     */
    /* ========================================= */
    
    /* Obliga a cualquier caja dentro de un flexbox a respetar la pantalla, 
       matando los width: 750px o 600px quemados en el HTML */
    .simpleflex > div, .spacedflex > div {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Nos aseguramos de que el texto largo se rompa y baje de línea */
    .curveInfo p, #presetDesc {
        white-space: normal !important;
        word-wrap: break-word !important;
    }
    /* ========================================= */
    /* 12. PÁGINA DE INICIO (Home / Index)       */
    /* ========================================= */
    
    /* 1. Volvemos el contenedor principal una columna vertical centrada */
    body > .middleflex > .middleflex {
        flex-direction: column !important;
        text-align: center;
        padding: 0 20px;
    }

    /* 2. Centramos el logo y lo hacemos un poco más adaptable */
    body > .middleflex > .middleflex > img {
        margin-right: 0px !important;
        margin-bottom: 20px !important;
        height: 120px !important; /* Un poco más pequeño para dejar respirar el texto */
    }

    /* 3. Reducimos los textos gigantes para que no rompan la pantalla */
    body > .middleflex > .middleflex h1 {
        font-size: 38px !important;
        line-height: 1.1 !important;
        margin-bottom: 15px !important;
    }

    body > .middleflex > .middleflex p {
        font-size: 18px !important;
        line-height: 1.5 !important; 
    }

    /* 4. Apilamos los botones y matamos el alto fijo de 50px */
    #buttonList {
        height: auto !important; 
        flex-direction: column !important;
        gap: 15px; /* Separación limpia entre botones */
    }

    #buttonList a, #buttonList button {
        width: 100% !important; /* Botones anchos, fáciles de tocar */
    }

    /* 5. Aseguramos que los créditos del fondo se mantengan centrados */
    body > .middleflex > .bottomBar {
        position: relative !important;
        margin-top: auto !important;
        bottom: 20px !important;
        left: 0 !important;
        width: 100%;
        display: flex;
        justify-content: center;
    }
    /* ========================================= */
        /* 13. PÁGINA DE SERVIDORES (Móvil)          */
        /* ========================================= */

        /* Le damos padding al contenedor del título para que no se pegue al borde */
        #everything > .centerflex {
            padding: 0 20px !important; 
            text-align: center; /* Aseguramos que el texto esté centrado */
            box-sizing: border-box; /* Previene que el padding estire la pantalla */
        }

        /* Reducimos ligeramente el tamaño de la fuente para que quepa mejor */
        #everything > .centerflex h2 {
            font-size: 26px !important; 
        }

        #everything > .centerflex p {
            font-size: 16px !important;
        }

        .serverOption {
        min-width: 0 !important; /* Matamos el ancho mínimo que rompe la pantalla */
        width: calc(100% - 40px) !important;
        height: auto !important; /* Permite que la tarjeta crezca si es necesario */
        padding: 15px !important;
    }

    /* Reducimos un poco la imagen del avatar para ahorrar espacio */
    .serverOption img[sv=icon] {
        height: 50px !important;
        margin-right: 15px !important;
    }

    /* Hacemos los iconos un poco más pequeños para que encajen mejor */
    .serverOption .serverIcons svg {
        width: 24px;
        height: 24px;
    }

    /* Reducimos el padding de los botones para que no ocupen tanto a lo ancho */
    .serverOption .serverIcons a {
        padding: 5px;
    }
    /* ========================================= */
    /* 14. TABLA DE CLASIFICACIÓN (MÓVIL)        */
    /* ========================================= */

    .leaderboardBox {
        padding: 0 10px !important; 
    }

    /* Contenedor principal de CADA tarjeta (Líderes, Roles, Progreso) */
    .leaderboardSlot {
        position: relative !important;
        height: auto !important; 
        padding: 15px !important; /* Padding uniforme */
        margin-bottom: 15px !important; 
        display: flex !important;
        flex-direction: column !important; /* Apilamos INFO arriba, BARRA abajo */
        align-items: flex-start !important; /* Todo forzado a la izquierda */
        justify-content: flex-start !important;
        gap: 15px !important; 
        box-sizing: border-box !important;
        overflow: hidden !important; 
    }

    /* Excepción: Solo la tarjeta del Top necesita más padding arriba por la insignia */
    .leaderboardSlot[slot="leaderboard"] {
        padding-top: 35px !important;
    }

    /* La insignia de rango (#1, #2...) flotante */
    .leaderboardSlot h2[lb="rank"] {
        position: absolute !important;
        top: 10px !important;
        left: 10px !important;
        font-size: 16px !important;
        background-color: var(--emojipurple) !important;
        padding: 4px 10px !important;
        border-radius: 8px !important;
        width: auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        color: white !important;
        z-index: 2 !important;
    }

    /* MATAMOS los márgenes (margin-right: 20px) y anchos forzados en el HTML */
    .leaderboardSlot > div {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important; 
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    /* Mitad superior: Textos e imagen */
    .leaderboardSlot .mainInfo {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important; /* Alineado arriba */
        justify-content: flex-start !important;
    }

    /* Contenedor del Avatar (Lo cazamos por su border-radius único en línea) */
    .leaderboardSlot .mainInfo > div[style*="420px"] {
        width: 55px !important;
        height: 55px !important;
        min-width: 55px !important;
        margin-left: 0 !important;
        margin-right: 15px !important; 
        flex-shrink: 0 !important; /* Evita que la foto se aplaste */
    }

    /* Contenedor de Textos */
    .leaderboardSlot .generalInfo {
        width: calc(100% - 70px) !important; 
        display: flex !important;
        flex-direction: column !important; /* Todo en columna vertical */
    }

    /* Nombre / ID (Más pequeño y con salto forzado) */
    .leaderboardSlot .generalInfo p[lb="name"] {
        font-size: 13px !important; 
        word-break: break-all !important; /* Obliga a romper los números largos a la fuerza */
        white-space: normal !important;
        line-height: 1.2 !important;
        margin: 0 0 4px 0 !important;
    }

    /* Contenedor de Nivel y Advertencias Rojas */
    .leaderboardSlot .generalInfo > div {
        display: flex !important;
        flex-direction: column !important; 
        align-items: flex-start !important;
        width: 100% !important;
    }

    .leaderboardSlot .generalInfo p[lb="level"] {
        margin: 0 !important;
    }

    /* Textos rojos de advertencia (Apilados debajo del nivel) */
    .leaderboardSlot .generalInfo p[lb="warning"],
    .leaderboardSlot .generalInfo p[lb="hideUser"] {
        margin-left: 0 !important;
        margin-top: 6px !important;
        white-space: normal !important;
        font-size: 14px !important;
        width: 100% !important;
        display: block !important;
    }


    /* ========================================= */
    /* 15. LA BARRA DE PROGRESO INQUEBRANTABLE   */
    /* ========================================= */

    /* Forzamos al contenedor de la barra a ser un bloque completo */
    .leaderboardSlot > div:last-child {
        display: block !important; 
    }

    /* La pista gris */
    .progressBar {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 35px !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 20px !important;
        position: relative !important;
        background-color: rgba(0, 0, 0, 0.33) !important;
        overflow: hidden !important; /* Corta cualquier excedente */
        box-sizing: border-box !important;
    }

    /* El relleno de color/blanco */
    .progressBar .progress {
        display: block !important;
        height: 100% !important;
        position: absolute !important; 
        top: 0 !important;
        left: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 20px !important;
        box-sizing: border-box !important;
    }

    /* Contenedor de texto de XP */
    .progressBar .xpOverlay {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 10px !important;
        display: flex !important;
        flex-direction: row !important; 
        justify-content: center !important; 
        align-items: center !important; 
        box-sizing: border-box !important;
    }

    /* Texto XP */
    .progressBar .xpOverlay p {
        font-size: 13px !important;
        text-align: center !important;
        white-space: nowrap !important;
        margin: 0 !important;
        padding: 0 !important;
        text-shadow: 1px 1px 2px black, -1px -1px 2px black !important;
        position: static !important;
        width: auto !important;
        min-width: 0 !important;
    }

    /* Botones de pestañas del Leaderboard */
    #lbButtons {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    #lbButtons button {
        width: 100% !important;
        margin: 0 !important;
    }
    /* ========================================= */
    /* 16. CENTRAR PAGINACIÓN                    */
    /* ========================================= */

    #pageInfo {
        display: flex !important;
        flex-direction: row !important; 
        justify-content: center !important; 
        align-items: center !important; 
        width: 100% !important;
        margin: 20px 0 !important;
    }

    #pageInfo p {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 !important;
        text-align: center !important;
        gap: 6px !important; /* <--- LA MAGIA: Añade 6px de espacio uniforme entre todo */
    }

    #pageInfo button {
        margin: 0 15px !important; 
    }

    /* Refuerzo por si el número está en un <span> separado */
    #totalPages {
        margin-left: 2px !important;
    }
}