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

:root {
    --primary: #83E4D1;
    --primary-dark: #5ac2af;
    --accent: #ff9f1c;
    --accent-hover: #e38a15;
    --text-dark: #2d3436;
    --text-light: #636e72;
    --bg-main: #f4f6f9;
    --card-bg: #ffffff;
    --surface: #fff;
    --bg: #f7f9fb;
    --teal: #83E4D1;
    --teal-dark: #5ac2af;
    --teal-light: #bdf5ea;
    --orange: #ff9f1c;
    --text: #2d3436;
    --muted: #636e72;
    --border: #dce8e6;
    --radius-md: 16px;
    --radius-lg: 28px;
    --shadow-md: 0 12px 35px rgba(0, 0, 0, .08);
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Salvavidas global: ninguna imagen puede desbordar su contenedor,
   aunque le falte una regla específica (ej. atributos HTML mal
   escritos como height="18px"). */
img {
    max-width: 100%;
    height: auto;
}

html {
    height: 100%;
    max-width: 100vw;
    overflow-x: clip;
}

body {
    max-width: 100vw;
    overflow-x: clip;
}

/* Shared base styles are defined globally */

main {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    box-sizing: border-box;
    overflow-x: clip;
}

.hero-section {
    text-align: center;
    background: white;
    padding: 50px 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border-top: 8px solid var(--accent);
}


.hero-title {
    display: inline-block;
    border-bottom: 2px dashed rgba(255, 140, 0, 0.5);
    padding-bottom: 4px;
    font-size: clamp(22px, 5vw, 38px);
    color: #111;
    margin: 0 0 15px 0;
}

#info-islas {
    border-radius: 15px;
    color: white;
    border: 5px orange solid;
    padding: 3px 15px;
    background-color: #ff9f1c;
    max-width: 100%;
    width: auto;
    height: auto;
    text-align: center;
    align-items: center;
    gap: 40px;
    font-size: clamp(24px, 5vw, 40px);
    box-sizing: border-box;
}

#lore {
    font-size: clamp(18px, 3.5vw, 30px);
}

.hero-subtitle {
    font-size: clamp(15px, 3.5vw, 19px);
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

/* Centralized animations used */

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.col-span-2 {
    grid-column: 1 / -1;
}

h2 {
    color: var(--accent);
    margin-top: 0;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    font-size: 24px;
}

.card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 5px solid var(--primary);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}

.card p {
    font-size: 17px;
    color: var(--text-light);
}

/* --- LAYOUT DE PERSONAJES PARA LA WIKI --- */
.character-layout {
    display: flex;
    align-items: center;
    gap: 30px;
}

.character-img {
    flex-shrink: 0;
    width: 180px;
}

.character-img img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

.character-info {
    flex-grow: 1;
}

.character-info h2 {
    border-bottom: none;
    margin-bottom: 10px;
    padding-bottom: 0;
}

.character-info p {
    margin: 0;
}

/* --- LISTAS Y NIVELES --- */
.custom-list li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    font-size: 17px;
    color: var(--text-light);
}

.custom-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
}

.check-list li::before {
    content: "";
}

.team-list {
    list-style: none;
    padding: 0;
}

.team-list li {
    background: #f8f9fa;
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
}

.alert-box {
    background-color: #fff3cd;
    border-left: 5px solid #ffc107;
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.alert-box p {
    margin: 0;
    color: #856404;
}

.video-hero {
    display: block;
    width: fit-content;
    margin: 0 auto;
    border: 4px solid #ff8c00;
    border-radius: 15px;
    padding: 5px;
    box-shadow: 0 0 20px rgba(255, 140, 0, 0.5);
}

.gif {
    text-align: center;
}

video {
    width: 100%;
    max-width: 70%;
    height: auto;
    display: block;
    margin: 0 auto;
    box-sizing: border-box;
}


/*==========================
        HERO BETO
===========================*/

.wiki-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 60px;
    background: #fff;
    border-radius: 25px;
    padding: 50px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, .08);
    border-top: 8px solid var(--primary);
}

.wiki-hero p {
    font-size: clamp(16px, 2.5vw, 25px);
}

.wiki-info {
    flex: 1;
}

.wiki-badge {
    display: inline-block;
    background: linear-gradient(90deg, #ffb703, #ff8c00);
    color: white;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.wiki-info h1 {
    font-size: 35px;
    margin: 0;
    color: #222;

}

.wiki-desc {
    margin: 25px 0;
    color: #666;
    line-height: 1.8;
    font-size: clamp(16px, 2.5vw, 22px);
}

.lore {
    font-size: 40px;
}

.wiki-image {
    width: 280px;
    max-width: 100%;
    flex-shrink: 0;
}

.wiki-image img {
    width: 100%;
    max-width: 100%;
    transition: .4s;
}

.wiki-image img:hover {
    transform: scale(1.08) rotate(-2deg);
}

.wiki-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat {
    background: #f7f9fb;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
}

.stat h3 {
    margin-bottom: 8px;
    color: var(--accent);
}

.stat p {
    margin: 0;
}


/*==========================
        SKINS
===========================*/

.skins {
    margin-top: 70px;
}

.skins h2 {
    text-align: center;
    margin-bottom: 35px;
    font-size: 34px;
}

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

.skin-card {
    background: white;
    border-radius: 22px;
    padding: 25px;
    text-align: center;
    transition: .35s;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .06);
    border-top: 6px solid var(--primary);
}

.skin-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .12);
}

.skin-card img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    transition: .35s;
}

.skin-card:hover img {
    transform: scale(1.12);

}

.skin-card h3 {
    margin-top: 18px;
    margin-bottom: 10px;
    color: #222;
}

.skin-card p {
    color: #666;
    font-size: 15px;
    margin-top: 15px;
}

.beto-hero {
    display: flex;
    align-items: center;
    gap: 60px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 52px;
    box-shadow: var(--shadow-md);
    border-top: 6px solid var(--teal);
    position: relative;
    overflow: hidden;
}

.beto-hero::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, var(--teal-light) 0%, transparent 70%);
    border-radius: 50%;
    opacity: .4;
}

.beto-info {
    flex: 1;
}

.beto-info h1 {
    font-size: 60px;
    margin: 8px 0 18px;
    background: linear-gradient(135deg, var(--teal-dark), var(--orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.beto-desc {
    font-size: 18px;
    color: var(--muted);
    line-height: 1.75;
    margin-bottom: 28px;
}

.beto-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.stat-chip {
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 1.5px solid var(--border);
    transition: border-color .2s, transform .2s;
}

.stat-chip:hover {
    border-color: var(--teal);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 22px;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--muted);
    font-weight: 700;
}

.stat-chip strong {
    font-size: 14px;
    color: var(--text);
}

.beto-image-wrap {
    width: 300px;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.beto-glow {
    position: absolute;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, var(--teal-light) 0%, transparent 70%);
    border-radius: 50%;
}

.beto-img {
    width: 100%;
    position: relative;
    z-index: 1;
    transition: transform .4s;
    filter: drop-shadow(0 8px 24px rgba(78, 207, 186, .3));
}

.beto-img:hover {
    transform: scale(1.07) rotate(-2deg);
}

/* Responsive adjustments for Lexiwiki */
@media (max-width: 900px) {
    .beto-hero {
        flex-direction: column;
        padding: 30px;
        gap: 30px;
        text-align: center;
    }

    .beto-info h1 {
        font-size: 42px;
    }

    .beto-image-wrap {
        width: 240px;
    }
}

@media (max-width: 600px) {
    .beto-stats {
        grid-template-columns: 1fr;
    }

    .beto-info h1 {
        font-size: 32px;
    }

    .beto-desc {
        font-size: 15px;
    }
}


.card li {
    font-size: clamp(16px, 2.5vw, 20px);
}

.card H2 {
    font-size: clamp(24px, 4vw, 35px);
}

/* =============================================
   DARK MODE OVERRIDES
   ============================================= */
body.dark-mode {
    --bg-main: #121220;
    --card-bg: #1a1a2e;
    --surface: #1a1a2e;
    --bg: #12122a;
    --text-dark: #e8e8f0;
    --text-light: #a0a0b8;
    --text: #e8e8f0;
    --muted: #a0a0b8;
    --border: #2a2a40;
    --teal-light: rgba(131, 228, 209, 0.15);
}

body.dark-mode .hero-section {
    background: var(--card-bg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body.dark-mode .hero-title {
    display: inline-block;
    border-bottom: 2px dashed rgba(255, 140, 0, 0.5);
    padding-bottom: 4px;
    color: var(--text-dark);
}

body.dark-mode .hero-subtitle {
    color: var(--text-light);
}

body.dark-mode .skin-card {
    background: var(--card-bg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .25);
}

body.dark-mode .skin-card h3 {
    color: var(--text-dark);
}

body.dark-mode .skin-card p {
    color: var(--text-light);
}

body.dark-mode .skins h2 {
    color: var(--text-dark);
}

body.dark-mode .faq-section h2 {
    color: var(--text-dark);
}

body.dark-mode .wiki-hero {
    background: var(--card-bg);
    box-shadow: 0 12px 35px rgba(0, 0, 0, .3);
}

body.dark-mode .wiki-info h1 {
    color: var(--text-dark);
}

body.dark-mode .wiki-desc {
    color: var(--text-light);
}

body.dark-mode .stat {
    background: var(--bg);
}

body.dark-mode .stat p {
    color: var(--text-dark);
}

/* =============================================
   DISEÑO RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    header h1 {
        font-size: 32px;
    }

    .hero-title {
        display: inline-block;
        border-bottom: 2px dashed rgba(255, 140, 0, 0.5);
        padding-bottom: 4px;
        font-size: 28px;
    }

    .character-layout {
        flex-direction: column;
        text-align: center;
    }

    .character-info h2 {
        text-align: center;
    }
}

@media(max-width:900px) {
    .wiki-hero {
        flex-direction: column;
        text-align: center;
    }

    .wiki-image {
        width: 250px;
    }

    .wiki-stats {
        grid-template-columns: 1fr;
    }

    .skins h2 {
        font-size: 28px;
    }
}

.hero-title:hover {
    cursor: pointer;
    color: var(--accent);
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* =============================================
   RESPONSIVE — TABLET
   ============================================= */
@media (max-width: 768px) {
    /* --- Contenedores principales --- */
    main {
        padding: 20px 14px;
        gap: 24px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: clip;
    }

    .hero-section {
        padding: 30px 16px;
        box-sizing: border-box;
    }

    /* --- Wiki hero y islas: layout vertical --- */
    .wiki-hero {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px 16px;
        gap: 24px;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
    }

    .wiki-image {
        width: 100%;
        max-width: 200px;
        flex-shrink: 0;
    }

    .wiki-image img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    .wiki-info {
        width: 100%;
    }

    .wiki-info h1 {
        font-size: 26px;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .wiki-desc {
        font-size: clamp(14px, 3.5vw, 18px);
    }

    /* --- Estadísticas a 1 columna --- */
    .wiki-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat {
        padding: 14px;
    }

    /* --- Videos --- */
    video {
        width: 100%;
        max-width: 100%;
    }

    /* --- Cards --- */
    .card {
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* --- Skins --- */
    .skins h2 {
        font-size: 24px;
    }

    .skins-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .skin-card {
        padding: 18px;
        box-sizing: border-box;
    }

    .skin-card img {
        width: 120px;
        height: 120px;
    }

    /* --- Info islas banner --- */
    #info-islas {
        border-width: 3px;
        padding: 3px 10px;
        font-size: clamp(18px, 4vw, 28px);
    }

    #lore {
        font-size: clamp(15px, 3.5vw, 22px);
    }

    /* --- Texto general: forzar wrap --- */
    h1, h2, h3, h4, p, strong, span, li, a, label {
        overflow-wrap: break-word !important;
        word-break: break-word !important;
        white-space: normal !important;
    }

    .card p,
    .card li,
    .card h2,
    .card h3,
    .wiki-desc,
    .hero-subtitle,
    .beto-desc,
    #info-islas,
    #lore {
        overflow-wrap: break-word;
        word-break: break-word;
        white-space: normal;
    }

    .beto-hero {
        flex-direction: column;
        padding: 30px 20px;
        gap: 30px;
        text-align: center;
        box-sizing: border-box;
    }

    .beto-image-wrap {
        width: 100%;
        max-width: 240px;
    }

    .beto-stats {
        grid-template-columns: 1fr;
    }

    .character-layout {
        flex-direction: column;
        text-align: center;
    }

    .character-img {
        width: 100%;
        max-width: 160px;
    }
}

/* =============================================
   RESPONSIVE — MÓVIL
   ============================================= */
@media (max-width: 480px) {
    main {
        padding: 16px 10px 80px;
        gap: 20px;
    }

    .wiki-hero {
        padding: 18px 12px;
        gap: 18px;
        border-radius: 16px;
    }

    .wiki-image {
        width: 100%;
        max-width: 160px;
    }

    .wiki-info h1 {
        font-size: 20px;
    }

    .wiki-desc {
        font-size: clamp(13px, 3.2vw, 16px);
        margin: 15px 0;
    }

    .wiki-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stat {
        padding: 12px;
    }

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

    .skin-card {
        padding: 14px;
    }

    .skin-card img {
        width: 100px;
        height: 100px;
    }

    .skins {
        margin-top: 30px;
    }

    .skins h2 {
        font-size: 20px;
    }

    .hero-section {
        padding: 22px 12px;
    }

    .hero-title {
        font-size: 22px;
    }

    .hero-subtitle {
        font-size: 15px;
    }

    .origenes {
        font-size: 14px !important;
    }

    #info-islas {
        font-size: 18px;
        border-width: 2px;
        padding: 3px 8px;
        word-break: break-word;
    }

    #lore {
        font-size: clamp(14px, 3.2vw, 18px);
    }

    .card {
        width: 100%;
        padding: 18px 14px;
        box-sizing: border-box;
        overflow: hidden;
    }

    .beto-hero {
        padding: 20px 14px;
        gap: 20px;
    }

    .beto-image-wrap {
        width: 100%;
        max-width: 200px;
    }

    .character-layout {
        flex-direction: column;
        text-align: center;
    }

    .character-img {
        width: 100%;
        max-width: 140px;
    }
}

/* =============================================
   CORRECCIÓN DE SCROLL — LEXIWIKI
   ============================================= */
/* Evita que overflow-x:hidden cree un contenedor de scroll y haga
   fallar position:sticky del header en algunos navegadores/hosting. */
html,
body {
    overflow-x: clip;
}

/* LEXICA FIX - evita que el contenido de Lexiwiki cree un scroll
   horizontal propio que interfiera con la página. */
main.page-content {
    overflow-x: clip !important;
}
