:root {
    --primary-yellow: #fee71c;
    --primary-black: #000000;
    --primary-white: #f3f3f3;
}

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

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--primary-white);
    color: var(--primary-black);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header & Navigation */
header {
    padding: 1.5rem 2rem 1rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1000;
    background-color: var(--primary-white);
    min-height: 110px;
    /* Mantener altura consistente */
}

.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo-img {
    height: 50px;
    width: auto;
}

.menu-container {
    position: absolute;
    right: 2rem;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 24px;
    width: 24px;
    align-items: center;
    padding: 2px 0;
}

.menu-bar {
    height: 5px;
    width: 5px;
    background-color: #555;
    border-radius: 0;
}

.menu-container nav {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--primary-white);
    width: 200px;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
    border-radius: 4px;
}

.menu-container nav.active {
    display: block;
}

.menu-container nav ul {
    list-style: none;
}

.menu-container nav ul li {
    border-bottom: 1px solid #eee;
}

.menu-container nav ul li:last-child {
    border-bottom: none;
}

.menu-container nav ul li a {
    display: block;
    padding: 1rem;
    text-decoration: none;
    color: #535353;
    font-weight: bold;
    transition: background-color 0.2s;
}

.menu-container nav ul li a:hover {
    background-color: #f0f0f0;
}

/* Submenú para Documentación */
.menu-container nav ul li ul {
    list-style: none;
    background-color: #f8f8f8;
    border-top: 1px solid #eee;
    margin: 0;
    padding: 0;
}

.menu-container nav ul li ul li {
    border-bottom: 1px solid #e5e5e5;
    margin: 0;
}

.menu-container nav ul li ul li:last-child {
    border-bottom: none;
}

.menu-container nav ul li ul li a {
    padding-left: 2rem;
    font-weight: 400;
    font-size: 0.95em;
    color: #666;
}

.menu-container nav ul li ul li a:hover {
    background-color: #f0f0f0;
    color: #535353;
}

.menu-container nav ul li ul li a.active {
    background-color: #e8e8e8;
    color: #535353;
    font-weight: 600;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    width: 100%;
    position: relative;
    /* Needed for canvas positioning */
    overflow: hidden;
    /* Contain canvas */
}

/* Fondo como pseudo-elemento (z-index más bajo) */
main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-white);
    z-index: 0;
}

.art-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    /* Increased to match visual prominence */
    z-index: 10;
    /* Ensure content is above background animation */
}

.main-art {
    width: 100%;
    height: auto;
    display: block;
    animation: matriozEntry 1.5s ease-out forwards;
}

/* Animación de entrada: fade + scale */
@keyframes matriozEntry {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}


.glyph {
    position: absolute;
    width: 8.5%;
    /* Adjusted size based on grid fit */
    height: auto;
    z-index: 10;
}

/* Positioning based on the provided image */
.glyph-blue {
    top: 54.5%;
    left: 31.5%;
    transform: translate(-50%, -50%);
    filter: brightness(0) saturate(100%) invert(11%) sepia(97%) saturate(7490%) hue-rotate(359deg) brightness(98%) contrast(108%);
}

.glyph-red {
    top: 64%;
    left: 43.5%;
    transform: translate(-50%, -50%);
    filter: brightness(0) saturate(100%) invert(42%) sepia(98%) saturate(2447%) hue-rotate(201deg) brightness(102%) contrast(101%);
}

/* Sponsors Section */
.sponsors-section {
    padding: 2rem;
    background-color: var(--primary-white);
    border-top: 1px solid #e0e0e0;
}

.sponsors-content {
    max-width: 1200px;
    margin: 0 auto;
}

.sponsors-logos {
    display: flex;
    gap: 3rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.sponsor-logo {
    height: 35px;
    width: auto;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.sponsor-logo:hover {
    opacity: 1;
}

/* Footer */
footer {
    padding: 2rem;
    text-align: center;
    background-color: var(--primary-white);
    margin-top: auto;
}

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

.footer-beca-text {
    font-size: 0.75rem;
    color: #535353;
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 2rem;
    line-height: 1.4;
}

.footer-text {
    font-size: 0.8rem;
    color: var(--primary-black);
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
}

.supporters-logos {
    display: flex;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
}

.supporter-logo-1 {
    height: 30px;
    width: auto;
    filter: brightness(0) saturate(0%) invert(20%);
}

.supporter-logo-2 {
    height: 18px;
    width: auto;
    filter: brightness(0) saturate(0%) invert(20%);
}

.text-logo {
    font-weight: thin;
    color: #535353;
    font-size: 0.9rem;
}

/* Responsive - Desktop */
@media (min-width: 768px) {
    header {
        padding: 3rem 5rem 2.5rem 5rem;
        min-height: 160px;
    }

    .logo-img {
        height: 85px;
    }

    .menu-toggle {
        height: 36px;
        width: 36px;
    }

    .menu-bar {
        height: 7px;
        width: 7px;
    }

    footer {
        padding: 4rem 5rem;
    }

    .footer-beca-text {
        font-size: 1rem;
        max-width: 800px;
        padding-bottom: 3rem;
    }

    .footer-text {
        font-size: 1.2rem;
    }

    .supporter-logo-1 {
        height: 55px;
    }

    .supporter-logo-2 {
        height: 34px;
    }

    .text-logo {
        font-size: 1.3rem;
    }

    .supporters-logos {
        gap: 4rem;
        margin-top: 1rem;
    }

    .sponsors-section {
        padding: 3rem 5rem;
    }

    .sponsors-logos {
        gap: 5rem;
    }

    .sponsor-logo {
        height: 70px;
    }
}

/* Resetario Cards & Page Containers */
.resetario-container,
.page-container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

/* Contact Info */
.contact-info {
    max-width: 700px;
    margin: 2rem auto 0;
    text-align: center;
    background-color: var(--primary-white);
    padding: 2.5rem 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.contact-info p {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #535353;
    margin-bottom: 1.5rem;
}

.contact-info p:last-child {
    margin-bottom: 0;
}

.contact-info a {
    color: var(--primary-black);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid #535353;
    transition: border-color 0.3s ease;
}

.contact-info a:hover {
    border-color: var(--primary-black);
}

.telegram-link {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.telegram-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: #535353;
    font-weight: 500;
    text-decoration: none;
    border: none;
    transition: all 0.3s ease;
    padding: 0.75rem 1.5rem;
    background-color: rgba(0, 0, 0, 0.03);
    border-radius: 50px;
}

.telegram-link a:hover {
    background-color: rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.telegram-icon {
    width: 24px;
    height: 24px;
    display: block;
}

.telegram-link span {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
}

/* Loading Container */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 2rem;
}

.loader {
    width: 60px;
    height: 60px;
    border: 5px solid var(--primary-white);
    border-top: 5px solid #535353;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

.loading-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    color: #535353;
    font-weight: 400;
}

.resetario-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #535353;
    margin-bottom: 2rem;
    text-align: center;
    background-color: var(--primary-white);
    padding: 0.5rem 1rem;
}

/* Manual metodológico – Documentación */
.manual-section {
    margin: 0 auto 3rem auto;
    max-width: 900px;
}

.manual-card {
    background-color: var(--primary-white);
    border-radius: 18px;
    padding: 1.8rem 1.6rem 1.9rem;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.manual-content {
    display: block;
}

.manual-text {
    flex: 1;
}

.manual-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #333333;
    margin-bottom: 0.9rem;
}

.manual-description {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    line-height: 1.8;
    color: #535353;
    margin-bottom: 1.4rem;
}

.manual-download {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    border: 1px solid #333333;
    color: #333333;
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    background-color: transparent;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.manual-download:hover {
    background-color: #333333;
    color: var(--primary-white);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.manual-download-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
}

.manual-download-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Imagen del manual */
.manual-image-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 1.2rem auto;
}

.manual-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

@media (min-width: 768px) {
    .manual-card {
        padding: 2.2rem 2.4rem 2.3rem;
    }
    .manual-image-wrapper {
        width: 100%;
        max-width: 100%;
        margin-bottom: 1.4rem;
    }

    .manual-title {
        font-size: 1.9rem;
    }

    .manual-description {
        font-size: 1.05rem;
    }
}

/* Resetario IA – panel blueprint en grises */
.resetario-ai-section {
    position: relative;
    margin: 0 auto 1.5rem auto;
    padding: 2.4rem 2.1rem 2.2rem;
    max-width: 960px;
    border-radius: 22px;
    /* Fondo blueprint en grises: plano, oscuro y con retícula sutil */
    background:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 20% 0, #32343a 0, #181a1f 45%, #101218 100%);
    background-size: 40px 40px, 40px 40px, 100% 100%;
    color: #e3e4e8;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.6),
        0 0 0 1px rgba(0, 0, 0, 0.25) inset;
    overflow: hidden;
}

/* Variante clara del panel Resetario IA */
.resetario-ai-section.resetario-ai-light {
    background:
        linear-gradient(rgba(0, 0, 0, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.08) 1px, transparent 1px),
        #f1f1f1;
    color: #1d1f24;
    box-shadow:
        0 10px 22px rgba(0, 0, 0, 0.14),
        0 0 0 1px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    background-size: 32px 32px, 32px 32px, 100% 100%;
}

.resetario-ai-section.resetario-ai-light::before {
    border-color: rgba(40, 42, 52, 0.18);
}

.resetario-ai-section.resetario-ai-light .tp7-disk {
    border-color: rgba(80, 82, 92, 0.7);
}

.resetario-ai-section.resetario-ai-light .tp7-disk::before {
    border-color: rgba(80, 82, 92, 0.45);
}

.resetario-ai-section.resetario-ai-light .tp7-disk::after {
    border-color: rgba(80, 82, 92, 0.5);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.resetario-ai-section.resetario-ai-light .tp7-disk-center {
    box-shadow: 0 0 0 1px rgba(80, 82, 92, 0.8);
}

.resetario-ai-section.resetario-ai-light .tp7-screen {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 0 0 1px rgba(40, 42, 52, 0.25);
    color: #161821;
}

.resetario-ai-section.resetario-ai-light .tp7-screen-meta-slot {
    border-color: rgba(40, 42, 52, 0.8);
}

.resetario-ai-section.resetario-ai-light .tp7-screen .resetario-ai-status {
    color: #4a4c56;
}

.resetario-ai-section.resetario-ai-light .resetario-ai-label {
    color: #3a3c44;
}

.resetario-ai-section.resetario-ai-light .resetario-ai-option {
    color: #3a3c44;
}

.resetario-ai-section.resetario-ai-light .resetario-ai-option input[type="checkbox"] {
    background: var(--primary-white);
    border-color: rgba(80, 82, 92, 0.6);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.7),
        inset 0 0 0 1px rgba(200, 202, 210, 0.8);
}

.resetario-ai-section.resetario-ai-light .resetario-ai-option input[type="checkbox"]::before {
    background: #20232c;
}

.resetario-ai-section.resetario-ai-light .theme-switch {
    color: #3a3c44;
}

.resetario-ai-section.resetario-ai-light .theme-switch-slider {
    background: var(--primary-white);
    border-color: rgba(120, 122, 132, 0.8);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.7),
        inset 0 0 0 1px rgba(200, 202, 210, 0.8);
}

.resetario-ai-section.resetario-ai-light .theme-switch-slider::before {
    background: #20232c;
}

.resetario-ai-section.resetario-ai-light .resetario-ai-button {
    background: rgba(252, 252, 255, 0.9);
    color: #101218;
    border-color: rgba(120, 122, 132, 0.8);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.25),
        0 4px 12px rgba(0, 0, 0, 0.25);
}

.resetario-ai-section.resetario-ai-light .resetario-ai-button:hover {
    background: rgba(240, 242, 250, 1);
}

.resetario-ai-section.resetario-ai-light .tp7-submit-button:disabled,
.resetario-ai-section.resetario-ai-light .tp7-submit-button.tp7-submit-disabled {
    opacity: 1;
    cursor: default;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.25),
        0 4px 12px rgba(0, 0, 0, 0.25);
}

.resetario-ai-section::before {
    content: '';
    position: absolute;
    inset: 9px;
    border-radius: 18px;
    border: 1px solid rgba(230, 232, 240, 0.2);
    pointer-events: none;
}

/* Disposición general del “dispositivo” TP-7 */
.resetario-ai-device {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    /* Dibujo tipo blueprint: solo contornos */
    color: #e3e5ec;
}

.tp7-top-row {
    display: flex;
    justify-content: space-between;
    gap: 1.8rem;
    align-items: center;
}

/* Panel izquierdo tipo blueprint basado en patrón de cuadrícula recursiva */
.tp7-disk {
    /* Círculo oculto completamente (no ocupa espacio) */
    display: none;
}

.tp7-disk::before {
    content: '';
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    border: 1px dashed rgba(220, 222, 232, 0.45);
}

.tp7-disk::after {
    content: '';
    position: absolute;
    inset: 22%;
    border-radius: 50%;
    border: 1px solid rgba(220, 222, 232, 0.4);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.7);
}

.tp7-disk-center {
    position: absolute;
    inset: 39%;
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 0 0 1px rgba(220, 222, 232, 0.8);
    z-index: 1;
}

/* Capa para dibujar glyphs dentro del círculo */
.tp7-disk-glyph-layer {
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    overflow: hidden;
    pointer-events: none;
    z-index: 3;
}

.tp7-disk-glyph {
    position: absolute;
    width: 20%;
    max-width: 90px;
    opacity: 0.95;
    transform: translate(-50%, -50%);
    z-index: 3;
}

.tp7-disk-glyph img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Colores de glyph según eje (tinte por filtros) */
.tp7-disk-glyph-agua img {
    filter: brightness(0) saturate(100%) invert(48%) sepia(83%) saturate(3926%) hue-rotate(200deg) brightness(103%) contrast(101%);
}

.tp7-disk-glyph-alimento img {
    filter: brightness(0) saturate(100%) invert(52%) sepia(94%) saturate(690%) hue-rotate(113deg) brightness(98%) contrast(96%);
}

.tp7-disk-glyph-cobijo img {
    filter: brightness(0) saturate(100%) invert(83%) sepia(93%) saturate(628%) hue-rotate(11deg) brightness(103%) contrast(104%);
}

.tp7-disk-glyph-energia img {
    filter: brightness(0) saturate(100%) invert(16%) sepia(99%) saturate(7443%) hue-rotate(2deg) brightness(103%) contrast(116%);
}

.tp7-disk-glyph-comunicacion img {
    filter: brightness(0) saturate(100%) invert(55%) sepia(95%) saturate(1025%) hue-rotate(337deg) brightness(101%) contrast(104%);
}

/* Pantalla derecha tipo “TODAY” */
.tp7-screen {
    position: relative;
    align-self: stretch;
    /* Que se vea claramente rectangular y horizontal y ocupe todo el ancho del aparato */
    padding: 0.55rem 1.4rem 0.7rem;
    width: 100%;
    max-width: 100%;
    border-radius: 10px;
    background: rgba(5, 7, 12, 0.9);
    box-shadow: 0 0 0 1px rgba(230, 232, 240, 0.4);
    color: var(--primary-white);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-height: 64px;
}

.tp7-screen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tp7-screen-label {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    letter-spacing: 0.12em;
    font-size: 0.82rem;
}

.tp7-screen-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    margin-top: 0.1rem;
}

.tp7-screen-meta-time {
    opacity: 0.8;
}

.tp7-screen-meta-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    padding: 0.08rem 0.25rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    font-weight: 600;
    font-size: 0.7rem;
}

.tp7-screen .resetario-ai-status {
    margin-top: 0.35rem;
    font-size: 0.7rem;
    color: #d4d7ec;
}

.tp7-middle {
    margin-top: 0.4rem;
}

.resetario-ai-title {
    position: relative;
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.resetario-ai-description {
    position: relative;
    max-width: 540px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #c7cad4;
    margin-bottom: 1.75rem;
}

.resetario-ai-form {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.resetario-ai-input-block {
    position: relative;
}

.resetario-ai-label {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #aeb2c0;
    margin-bottom: 0.4rem;
}

/* Switch de tema claro/oscuro */
.resetario-ai-theme-toggle {
    margin-bottom: 0.9rem;
    display: none;
    justify-content: flex-end;
}

.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    color: #d0d2dd;
}

.theme-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-switch-slider {
    width: 34px;
    height: 18px;
    border-radius: 999px;
    background: rgba(15, 18, 26, 0.9);
    border: 1px solid rgba(220, 222, 232, 0.6);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.8),
        inset 0 0 0 1px rgba(30, 32, 40, 0.8);
    position: relative;
    cursor: pointer;
}

.theme-switch-slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 3px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--primary-white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    transition: transform 0.16s ease-out;
}

.theme-switch input:checked + .theme-switch-slider::before {
    transform: translateX(13px);
}

.theme-switch-label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.resetario-ai-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    margin-top: 0.5rem;
}

.resetario-ai-option {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    color: #e3e5ec;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.resetario-ai-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid rgba(220, 222, 232, 0.6);
    background: rgba(8, 10, 16, 0.9);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.8),
        inset 0 0 0 1px rgba(30, 32, 40, 0.8);
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
    position: relative;
}

.resetario-ai-option input[type="checkbox"]::before {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: 2px;
    background: var(--primary-white);
    opacity: 0;
    transition: opacity 0.14s ease-out;
}

.resetario-ai-option input[type="checkbox"]:checked::before {
    opacity: 1;
}

.resetario-ai-option input[type="checkbox"]:focus-visible {
    outline: 2px solid #4598ff;
    outline-offset: 2px;
}

.resetario-ai-textarea {
    width: 100%;
    min-height: 110px;
    padding: 1rem 1.1rem;
    border-radius: 14px;
    border: 1px solid rgba(220, 222, 232, 0.5);
    background: rgba(10, 12, 18, 0.6);
    color: #f4f5fb;
    resize: vertical;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.resetario-ai-textarea::placeholder {
    color: #878ca0;
}

.resetario-ai-textarea:focus-visible {
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.4),
        0 0 0 1px rgba(0, 0, 0, 0.9) inset;
}

.resetario-ai-button {
    position: relative;
    padding: 0.9rem 1.6rem;
    border-radius: 10px;
    border: 1px solid rgba(220, 222, 232, 0.8);
    background: rgba(230, 231, 236, 0.06);
    color: var(--primary-white);
    font-family: 'Outfit', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.7),
        0 6px 16px rgba(0, 0, 0, 0.65);
    transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, background 0.15s ease-out;
}

.tp7-submit-button:disabled,
.tp7-submit-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.4);
}

.resetario-ai-button:hover {
    background: rgba(230, 231, 236, 0.14);
}

.resetario-ai-button:active {
    transform: translateY(2px);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.9),
        0 3px 8px rgba(0, 0, 0, 0.8);
}

.resetario-ai-status {
    position: relative;
    margin-top: 0.8rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    color: #9da1b0;
    min-height: 1.1rem;
}

.resetario-ai-answer {
    position: relative;
    margin-top: 0.4rem;
}

.resetario-ai-answer h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.98rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #bdbdbd;
    margin-bottom: 0.75rem;
}

/* Sección de respuesta, centrada bajo el aparato */
/* Sección de respuesta simple bajo el aparato */
.resetario-ai-answer-section {
    margin-top: 0.5rem;
    padding: 1.2rem 1rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.resetario-ai-answer {
    width: 100%;
    max-width: 1200px;
    background: transparent;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2.2rem 2rem;
}

.resetario-ai-answer-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #fee71c;
    margin-bottom: 0.75rem;
}

.resetario-ai-answer-text {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--primary-white);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.75rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* Modo información inicial: comportamiento original, sin carrusel */
.resetario-ai-answer-text.info-mode {
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    overflow-x: visible;
    scroll-snap-type: none;
}

/* Carrusel solo para las tarjetas de tácticas dentro del aparato */
.tactics-carousel {
    flex-wrap: nowrap;
    justify-content: center;
    align-items: stretch;
    overflow-x: hidden;
    overflow-y: hidden;
    scroll-snap-type: none;
}

.tactics-nav {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    color: var(--primary-white);
}

.tactics-nav-button {
    min-width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(220, 222, 232, 0.8);
    background: rgba(8, 10, 16, 0.9);
    color: var(--primary-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.15s ease-out, transform 0.08s ease-out, opacity 0.15s ease-out;
}

.tactics-nav-button:disabled {
    opacity: 0.35;
    cursor: default;
}

.tactics-nav-button:not(:disabled):hover {
    background: rgba(230, 231, 236, 0.18);
}

.tactics-nav-button:not(:disabled):active {
    transform: translateY(1px);
}

.tactics-counter {
    opacity: 0.8;
    letter-spacing: 0.08em;
}

/* Ocultar barra de navegación de tácticas cuando se muestra la tarjeta de info */
.resetario-ai-answer-text.info-mode + .tactics-nav {
    display: none;
}

.resetario-ai-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

/* ===========================
   Re(s)etario output (barras)
   =========================== */
.resetario-output {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    border-radius: 14px;
    /* Reducimos padding superior para que las barras toquen casi el borde */
    padding: 0.4rem 1.4rem 0.9rem;
    /* Fondo blanco primario como en el diseño */
    background: var(--primary-white);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
    color: #000;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.resetario-output-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 0;
    /* Franja gris superior, misma estética que el footer */
    margin-left: -1.4rem;
    margin-right: -1.4rem;
    margin-top: -0.4rem;
    padding: 0.5rem 1.4rem 0.45rem;
    background: #535353;
    border-radius: 14px 14px 0 0;
}

.resetario-output-title-main {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--primary-white);
}

.resetario-output-title-sub {
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    opacity: 0.9;
    color: var(--primary-white);
    margin-top: 0.2rem;
}

.resetario-output-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    padding: 0.15rem 0.35rem;
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0, 0.6);
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
}

.resetario-output-body {
    display: block;
    margin-top: 0.6rem;
}

.resetario-sections {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.resetario-section {
    padding: 0.45rem 0 0.55rem;
}

.resetario-section + .resetario-section {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.resetario-section-label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #777;
    margin-bottom: 0.25rem;
}

.resetario-section-content {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
}

.resetario-section-content p {
    margin: 0;
}

.resetario-section-empty {
    font-size: 0.85rem;
    color: #999;
}

.resetario-output-text {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
}

.resetario-output-bars {
    /* Ocultamos temporalmente las barras del Resetario */
    display: none;
}

.resetario-tactic-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    white-space: nowrap;
}

.resetario-tactic-text {
    flex: 1 1 auto;
}

.resetario-tactics-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.resetario-tactic-badge-blue {
    background: linear-gradient(135deg, rgba(69, 152, 255, 0.75) 0%, rgba(53, 128, 230, 0.75) 100%);
}

.resetario-tactic-badge-green {
    background: linear-gradient(135deg, rgba(0, 208, 132, 0.75) 0%, rgba(0, 168, 105, 0.75) 100%);
}

.resetario-tactic-badge-yellow {
    background: linear-gradient(135deg, rgba(254, 231, 28, 0.8) 0%, rgba(253, 216, 0, 0.8) 100%);
    color: #333;
}

.resetario-tactic-badge-red {
    background: linear-gradient(135deg, rgba(253, 2, 2, 0.8) 0%, rgba(204, 0, 0, 0.8) 100%);
}

.resetario-tactic-badge-orange {
    background: linear-gradient(135deg, rgba(255, 132, 53, 0.95) 0%, rgba(255, 90, 0, 0.95) 100%);
}

.resetario-tactic-badge-neutral {
    background: #e0e0e0;
    color: #555;
}

.resetario-bar {
    width: 10px;
    border-radius: 0 0 3px 3px;
    background: rgba(255, 255, 255, 0.1);
}

.resetario-bar-red {
    background: linear-gradient(180deg, #fd7a7a 0%, #fd0202 100%);
}

.resetario-bar-blue {
    background: linear-gradient(180deg, #7fb3ff 0%, #4598ff 100%);
}

.resetario-bar-green {
    background: linear-gradient(180deg, #6ce3b0 0%, #00d084 100%);
}

.resetario-bar-yellow {
    background: linear-gradient(180deg, #ffef7a 0%, #fee71c 100%);
}

.resetario-bar-orange {
    background: linear-gradient(180deg, #ffb36e 0%, #ff6b35 100%);
}

.resetario-bar-neutral {
    background: linear-gradient(180deg, #ffffff 0%, #cccccc 100%);
}

.resetario-output-footer {
    margin-top: 0.8rem;
    /* Extender la franja gris hasta los bordes del contenedor blanco */
    margin-left: -1.4rem;
    margin-right: -1.4rem;
    margin-bottom: -0.9rem;
    padding: 0.5rem 1.4rem;
    background: #535353;
    border-radius: 0 0 14px 14px;
    text-align: right;
}

.resetario-output-hash {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--primary-white);
}

@media (max-width: 768px) {
    .resetario-ai-device {
        max-width: 100%;
    }

    .resetario-output {
        max-width: 100%;
        padding: 1rem 1rem 0.8rem;
    }

    /* Ajustar las franjas grises para que coincidan con el padding del contenido */
    .resetario-output-header,
    .resetario-output-footer {
        margin-left: -1rem;
        margin-right: -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .resetario-output-body {
        align-items: flex-end;
    }
}

/* Tarjeta de información inicial del Re(s)etario AI */
.resetario-ai-info-card {
    width: 100%;
    max-width: 920px;
}

.resetario-ai-info-front {
    width: 100%;
    border-radius: 16px;
    background: linear-gradient(180deg, #3d3f45 0%, #23252a 55%, #181a1f 100%);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
    padding: 2.8rem 2.6rem;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.4rem;
}

.resetario-ai-info-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    opacity: 0.95;
}

.resetario-ai-info-label {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: capitalize;
    color: var(--primary-white);
}

@media (max-width: 768px) {
    .page-container {
        padding: 1.25rem;
    }

    .resetario-ai-info-card {
        max-width: 100%;
    }

    .resetario-ai-info-front {
        padding: 1.6rem 1.4rem;
    }

    .resetario-ai-info-label {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .resetario-ai-answer-section {
        margin-top: 1rem;
        padding: 1.25rem 0 3rem;
    }

    .resetario-ai-answer {
        padding: 1.25rem 0;
    }
}

/* Tarjeta de respuesta tipo flip card */
.ai-answer-card {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    perspective: 1200px;
    cursor: pointer;
}

.ai-answer-card-inner {
    position: relative;
    width: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.ai-answer-card.flipped .ai-answer-card-inner {
    transform: rotateY(180deg);
}

.ai-answer-card-front,
.ai-answer-card-back {
    position: relative;
    width: 100%;
    min-height: 140px;
    padding: 1.2rem 1.4rem;
    border-radius: 12px;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ai-answer-card-front {
    background: radial-gradient(circle at top left, #565a62 0, #25272c 55%, #16181d 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.ai-answer-card-front h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #f3f3f3;
    margin-bottom: 0.5rem;
}

.ai-answer-card-front p {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    color: #c2c5d0;
}

.ai-answer-card-back {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotateY(180deg);
    background: linear-gradient(160deg, #050609, #161821);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.ai-answer-card-back h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #e3e4ec;
    margin-bottom: 0.75rem;
}

#resetario-ai-answer-text {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #f3f3f3;
}


/* Barra de transporte inferior (tres teclas) */
.tp7-transport-bar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
    align-items: stretch;
}

.tp7-eje-button {
    position: relative;
    border-radius: 6px;
    border: 1px solid rgba(220, 222, 232, 0.5);
    background: rgba(8, 10, 16, 0.7);
    color: #e3e5ec;
    font-family: 'Outfit', sans-serif;
    font-size: 0;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.55rem 0.4rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    transition: background 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out,
        transform 0.08s ease-out;
}

.tp7-eje-button:hover {
    background: rgba(230, 231, 236, 0.12);
    border-color: rgba(240, 242, 252, 0.8);
}

.tp7-eje-button.active {
    color: #ffffff;
}

/* Colores por defecto (claros) para cada eje */
.tp7-eje-button[data-eje="agua"] {
    background: linear-gradient(135deg, rgba(69, 152, 255, 0.75) 0%, rgba(53, 128, 230, 0.75) 100%);
    border-color: #4598ff;
}

.tp7-eje-button[data-eje="alimento"] {
    background: linear-gradient(135deg, rgba(0, 208, 132, 0.75) 0%, rgba(0, 168, 105, 0.75) 100%);
    border-color: #00d084;
}

.tp7-eje-button[data-eje="cobijo"] {
    background: linear-gradient(135deg, rgba(254, 231, 28, 0.8) 0%, rgba(253, 216, 0, 0.8) 100%);
    border-color: #fee71c;
}

.tp7-eje-button[data-eje="energia"] {
    background: linear-gradient(135deg, rgba(253, 2, 2, 0.8) 0%, rgba(204, 0, 0, 0.8) 100%);
    border-color: #fd0202;
}

.tp7-eje-button[data-eje="comunicacion"] {
    background: linear-gradient(135deg, rgba(255, 132, 53, 0.95) 0%, rgba(255, 90, 0, 0.95) 100%);
    border-color: #ff6b00;
}

/* Estado activo: versión más oscura del mismo color */
.tp7-eje-button[data-eje="agua"].active {
    background: linear-gradient(135deg, #2764c9 0%, #184fa8 100%);
    border-color: #2764c9;
    box-shadow: 0 0 10px rgba(39, 100, 201, 0.7);
}

.tp7-eje-button[data-eje="alimento"].active {
    background: linear-gradient(135deg, #00945e 0%, #007247 100%);
    border-color: #00945e;
    box-shadow: 0 0 10px rgba(0, 148, 94, 0.7);
}

.tp7-eje-button[data-eje="cobijo"].active {
    background: linear-gradient(135deg, #d6b800 0%, #ad9200 100%);
    border-color: #d6b800;
    box-shadow: 0 0 10px rgba(214, 184, 0, 0.7);
}

.tp7-eje-button[data-eje="energia"].active {
    background: linear-gradient(135deg, #b40000 0%, #7f0000 100%);
    border-color: #b40000;
    box-shadow: 0 0 10px rgba(180, 0, 0, 0.7);
}

.tp7-eje-button[data-eje="comunicacion"].active {
    background: linear-gradient(135deg, #c54200 0%, #8a2a00 100%);
    border-color: #c54200;
    box-shadow: 0 0 10px rgba(197, 66, 0, 0.8);
}

.tp7-submit-button {
    margin-top: 1rem;
    width: 100%;
}

.tp7-key-rec::before {
    border-radius: 999px;
    width: 32%;
    height: 32%;
    inset: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, #f73232 0, #b70707 70%, #3a0505 100%);
}

.tp7-key-play::before {
    clip-path: polygon(32% 22%, 78% 50%, 32% 78%);
}

.tp7-key-stop::before {
    inset: 33%;
    border-radius: 3px;
}

.tp7-key-play {
    cursor: pointer;
}

/* Fila de controles (Esc + Re(s)et) */
.tp7-control-row {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.tp7-esc-button {
    flex: 0 0 auto;
    min-width: 80px;
}

.tp7-control-row .tp7-submit-button {
    flex: 1 1 auto;
    margin-top: 0;
}

.tp7-key-play:hover {
    background: linear-gradient(145deg, #ffffff, #d3d3d3);
}

.tp7-key-play:active {
    transform: translateY(2px);
    box-shadow:
        0 3px 0 #9c9c9c,
        0 6px 10px rgba(0, 0, 0, 0.7);
}

/* Layout responsive del panel IA */
@media (max-width: 768px) {
    .resetario-ai-section {
        padding: 1.9rem 1.4rem 2rem;
        margin-bottom: 1rem;
        margin-left: -2rem;
        margin-right: -2rem;
        width: calc(100% + 4rem);
    }

    .tp7-top-row {
        flex-direction: row;
        gap: 1.2rem;
    }

    .tp7-disk {
        max-width: 80px;
    }

    .tp7-middle {
        margin-top: 0.2rem;
    }
}

/* Grafo de colores */
.color-graph {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 10;
}

.color-node {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.color-node:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.color-node.active {
    transform: scale(1.15);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    border: 1px solid var(--primary-white);
    outline: 1px solid #000;
}

.color-node.color-red {
    background: linear-gradient(135deg, #fd0202 0%, #cc0000 100%);
}

.color-node.color-blue {
    background: linear-gradient(135deg, #4598ff 0%, #3580e6 100%);
}

.color-node.color-green {
    background: linear-gradient(135deg, #00d084 0%, #00b370 100%);
}

.color-node.color-yellow {
    background: linear-gradient(135deg, #fee71c 0%, #fdd800 100%);
}

.color-node.color-orange {
    background: linear-gradient(135deg, #ff6b35 0%, #e6551c 100%);
}

.cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    align-items: flex-start;
}

@keyframes fadeInCard {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.reset-card {
    width: 100%;
    /* Un poco más pequeñas en desktop */
    max-width: 280px;
    flex: 0 0 auto;
    scroll-snap-align: center;
    perspective: 1000px;
    cursor: pointer;
    animation: fadeInCard 0.6s ease forwards;
}

.reset-card.active {
    opacity: 1;
}

.card-inner {
    position: relative;
    width: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.reset-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    width: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    background: transparent;
}

.card-front {
    position: relative;
    transform: rotateY(0deg);
}

.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotateY(180deg);
    background: linear-gradient(135deg, var(--primary-white) 0%, #e0e0e0 100%);
    justify-content: center;
    align-items: center;
    padding: 2.6rem 2.2rem;
    border-radius: 12px;
    overflow: hidden;
}

.card-back-content {
    text-align: center;
    color: #2d2d2d;
}

.card-back-content h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #000;
}

.card-back-content p {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #555;
}

/* Estilos para tarjeta de información */
.card-info .card-top {
    background: linear-gradient(135deg, #535353 0%, #3a3a3a 100%) !important;
}

.card-info .card-back {
    padding: 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.card-info .card-back-content {
    width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
}

.card-info .card-back-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}

.info-content {
    text-align: left;
    max-width: 100%;
    flex: 1;
    overflow-y: auto;
}

.info-content p {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.info-content p strong {
    font-size: 0.95rem;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

.info-list li {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #555;
    margin-bottom: 0.4rem;
    padding-left: 1.2rem;
    position: relative;
}

.info-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #535353;
    font-weight: bold;
}

.info-colors {
    margin-top: 0.75rem;
}

.info-color-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.info-color-circle {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.info-color-text {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #555;
}

.info-color-text strong {
    color: #2d2d2d;
    font-weight: 600;
}

/* Spinner de carga */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

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

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* Teclado Teenage Engineering Style */
.keyboard-section {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto 3rem auto;
    padding: 2rem;
    background: var(--primary-white);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Display de Glyphs */
.glyph-display {
    width: 100%;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #2d2d2d;
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.display-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 100px;
    padding: 1rem;
    background: #1a1a1a;
    border-radius: 4px;
    overflow-x: auto;
    overflow-y: hidden;
}

.display-screen::-webkit-scrollbar {
    height: 6px;
}

.display-screen::-webkit-scrollbar-track {
    background: #0d0d0d;
    border-radius: 3px;
}

.display-screen::-webkit-scrollbar-thumb {
    background: #535353;
    border-radius: 3px;
}

.display-screen::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.display-glyph {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-white);
    border-radius: 4px;
    padding: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.display-glyph img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0);
}

.display-glyph.display-color-red {
    background: #fd0202;
}

.display-glyph.display-color-blue {
    background: #4598ff;
}

.display-glyph.display-color-green {
    background: #00d084;
}

.display-glyph.display-color-yellow {
    background: #fee71c;
}

.display-glyph.display-color-orange {
    background: #ff6b35;
}

.display-glyph[class*="display-color-"] img {
    filter: brightness(0) invert(1);
}

.keyboard-grid {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto 1fr auto;
    gap: 16px;
    grid-template-areas:
        "s1 s2 ."
        "s1 s3 s5"
        "s1 s4 s5";
    align-items: stretch;
}

/* Sectores del teclado */
/* S1 - ESC y ALT (izquierda vertical) */
.keyboard-left-sector {
    grid-area: s1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

/* S2 - Teclas de color (arriba centro) */
.keyboard-top-sector {
    grid-area: s2;
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    padding-bottom: 8px;
}

/* S3 - Teclas Glyph (centro grande) */
.keyboard-center-sector {
    grid-area: s3;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
}

/* S4 - Barra espaciadora (abajo centro) */
.keyboard-bottom-sector {
    grid-area: s4;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

/* S5 - Enter (derecha vertical) */
.keyboard-right-sector {
    grid-area: s5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.keyboard-version {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    color: #999;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.key {
    width: 100%;
    aspect-ratio: 1;
    max-width: 70px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    box-shadow: 0 4px 0 #c0c0c0, 0 5px 8px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.1s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.key:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #c0c0c0, 0 3px 6px rgba(0, 0, 0, 0.15);
}

.key:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #c0c0c0, 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* Teclas con glifos */
.key-glyph {
    background: var(--primary-white);
    box-shadow: 0 4px 0 #d0d0d0, 0 5px 8px rgba(0, 0, 0, 0.15);
}

.key-glyph img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    filter: invert(30%) sepia(5%) saturate(0%) hue-rotate(180deg) brightness(95%) contrast(85%);
}

/* Teclas de colores */
.key-color {
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3), 0 5px 8px rgba(0, 0, 0, 0.2);
    max-width: 50px;
}

.key-color.key-red {
    background: #fd0202;
}

.key-color.key-blue {
    background: #4598ff;
}

.key-color.key-green {
    background: #00d084;
}

.key-color.key-yellow {
    background: #fee71c;
}

.key-color.key-orange {
    background: #ff6b35;
}

/* Teclas especiales (ESC, ALT, ENTER) */
.key-special {
    background: #e8e8e8;
    box-shadow: 0 4px 0 #b8b8b8, 0 5px 8px rgba(0, 0, 0, 0.1);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    opacity: 0.5;
}

.key-special .key-label {
    color: #555;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.key-special.key-esc,
.key-special.key-alt {
    width: 70px;
    height: 70px;
    min-width: 70px;
    max-width: 70px;
    transition: opacity 0.2s ease;
}

.key-special.key-esc:hover,
.key-special.key-alt:hover {
    opacity: 1;
}

.key-special.key-esc:hover .key-label,
.key-special.key-alt:hover .key-label {
    color: #2d2d2d;
    opacity: 1;
}

.key-enter-large {
    width: 100px;
    height: 100px;
    max-width: 100px;
    aspect-ratio: 1;
    background: #535353;
    opacity: 1;
    box-shadow: 0 4px 0 #2a2a2a, 0 5px 8px rgba(0, 0, 0, 0.3);
}

.key-enter-large .key-label {
    color: var(--primary-white);
    font-size: 0.9rem;
}

.key-enter-large:hover {
    box-shadow: 0 2px 0 #2a2a2a, 0 3px 6px rgba(0, 0, 0, 0.3);
}

.key-enter-large:active {
    box-shadow: 0 0 0 #2a2a2a, 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Teclas vacías */
.key-empty {
    background: #e8e8e8;
    box-shadow: 0 4px 0 #b8b8b8, 0 5px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.key-empty:not(:disabled):hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #b8b8b8, 0 3px 6px rgba(0, 0, 0, 0.15);
    opacity: 1;
}

.key-empty:not(:disabled):active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #b8b8b8, 0 2px 4px rgba(0, 0, 0, 0.2);
}

.key-empty:disabled {
    cursor: default;
    opacity: 0.5;
}

/* Barra espaciadora */
.key-spacebar {
    width: 70px;
    height: 70px;
    max-width: 70px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key-spacebar svg {
    color: #535353;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.key-spacebar:not(:disabled):hover svg {
    opacity: 1;
}

/* Responsive para el teclado */
@media (max-width: 1024px) {
    .keyboard-center-sector {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 768px) {
    .keyboard-section {
        padding: 1rem;
    }

    .glyph-display {
        padding: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .display-screen {
        min-height: 60px;
        padding: 0.5rem;
        gap: 8px;
    }

    .display-glyph {
        width: 40px;
        height: 40px;
        padding: 6px;
    }

    .keyboard-grid {
        gap: 10px;
        grid-template-rows: auto 1fr auto;
    }

    .keyboard-center-sector {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .keyboard-top-sector {
        gap: 6px;
    }

    .keyboard-left-sector {
        gap: 6px;
    }

    .key {
        max-width: 50px;
        border-radius: 3px;
        box-shadow: 0 3px 0 #c0c0c0, 0 4px 6px rgba(0, 0, 0, 0.15);
    }

    .key-spacebar {
        width: 50px;
        height: 50px;
        max-width: 50px;
    }

    .key-color {
        max-width: 40px;
    }

    .key-special .key-label {
        font-size: 0.7rem;
    }

    .key-special.key-esc,
    .key-special.key-alt {
        width: 50px;
        height: 50px;
        min-width: 50px;
        max-width: 50px;
    }

    .key-enter-large {
        width: 70px;
        height: 70px;
        max-width: 70px;
        aspect-ratio: 1;
        box-shadow: 0 3px 0 #2a2a2a, 0 4px 6px rgba(0, 0, 0, 0.3);
    }

    .key-enter-large:hover {
        box-shadow: 0 1px 0 #2a2a2a, 0 2px 4px rgba(0, 0, 0, 0.3);
    }

    .key-enter-large:active {
        box-shadow: 0 0 0 #2a2a2a, 0 1px 3px rgba(0, 0, 0, 0.3);
    }

    .key-enter-large .key-label {
        font-size: 0.7rem;
    }
}

.reset-card:hover .card-front,
.reset-card:hover .card-back {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.card-top {
    background: linear-gradient(135deg, #4598ff 0%, #3580e6 100%);
    padding: 2.4rem 1.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 170px;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.card-red .card-top {
    background: linear-gradient(135deg, #fd0202 0%, #cc0000 100%) !important;
}

.card-green .card-top {
    background: linear-gradient(135deg, #00d084 0%, #00b370 100%) !important;
}

.card-yellow .card-top {
    background: linear-gradient(135deg, #fee71c 0%, #fdd800 100%) !important;
}

.card-orange .card-top {
    background: linear-gradient(135deg, #ff6b35 0%, #e6551c 100%) !important;
}

/* Tarjeta de instrucciones */
.card-instructions {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) translateY(0) !important;
}

.card-instructions .card-inner {
    display: flex;
    flex-direction: column;
}

.card-instructions .card-front {
    position: relative !important;
    transform: rotateY(0deg) !important;
    display: flex;
    flex-direction: column;
}

.card-top-instructions {
    background: var(--primary-white);
    padding: 3rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.instructions-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #535353;
}

.card-bottom-instructions {
    background: linear-gradient(135deg, #4a4a4a 0%, #2d2d2d 100%);
    padding: 2.5rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.card-bottom-instructions p {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    color: #ffffff;
    text-align: center;
    margin: 0;
    line-height: 1.6;
}

.card-glyph {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    display: block;
    margin: 0;
}

.card-bottom {
    background: linear-gradient(135deg, #4a4a4a 0%, #2d2d2d 100%);
    padding: 2rem 1.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 130px;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.card-number {
    font-family: 'Outfit', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 0.1em;
    text-align: center;
    margin: 0;
    padding: 0;
    line-height: 1;
}

/* Responsive para tarjetas */
@media (max-width: 768px) {
    .resetario-container {
        max-width: 100%;
        padding: 1.5rem 2rem;
        margin-left: -2rem;
        margin-right: -2rem;
        width: calc(100% + 4rem);
    }

    .keyboard-section {
        width: calc(100% + 4rem);
        margin-left: -2rem;
        margin-right: -2rem;
        border-radius: 8px;
    }

    .resetario-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .color-graph {
        gap: 0.75rem;
        margin-bottom: 2rem;
    }

    .color-node {
        width: 32px;
        height: 32px;
        border-radius: 6px;
    }

    .cards-grid {
        gap: 1.5rem;
    }

    .reset-card {
        max-width: 280px;
    }

    .card-top {
        padding: 2rem 1.5rem;
        min-height: 150px;
    }

    .card-glyph {
        width: 80px;
        height: 80px;
        object-fit: contain;
    }

    .card-bottom {
        padding: 1.5rem 1.5rem;
        min-height: 100px;
    }

    .card-number {
        font-size: 2.5rem;
    }

    .card-back-content h3 {
        font-size: 1.3rem;
    }

    .card-back-content p {
        font-size: 0.8rem;
    }

    .card-top-instructions {
        padding: 2rem 1.5rem;
    }

    .instructions-circle {
        width: 60px;
        height: 60px;
    }

    .card-bottom-instructions {
        padding: 1.5rem 1.5rem;
    }

    .card-bottom-instructions p {
        font-size: 1rem;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .cards-grid {
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    .cards-grid {
        gap: 2rem;
        max-width: 1200px;
        margin: 0 auto;
    }

    .resetario-title {
        font-size: 3rem;
        margin-bottom: 4rem;
    }

    .contact-info {
        padding: 3.5rem 3rem;
        margin-top: 3rem;
    }

    .contact-info p {
        font-size: 1.3rem;
        margin-bottom: 2rem;
    }

    .telegram-link {
        margin-top: 3rem;
        padding-top: 2.5rem;
    }

    .telegram-link a {
        padding: 1rem 2rem;
    }

    .telegram-icon {
        width: 28px;
        height: 28px;
    }

    .telegram-link span {
        font-size: 1.1rem;
    }

    .loading-container {
        padding: 6rem 2rem;
    }

    .loader {
        width: 80px;
        height: 80px;
        border-width: 6px;
    }

    .loading-text {
        font-size: 1.5rem;
    }
}

/* Sección de Opciones */
.combinations-section {
    width: 100%;
    max-width: 1000px;
    margin: 3rem auto;
    padding: 2rem;
}

.combinations-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    color: var(--primary-black);
    margin-bottom: 2rem;
    text-align: center;
}

/* Título específico del contenedor de tácticas del aparato */
#resetario-ai-answer-title.combinations-title {
    font-size: 1.1rem;
    color: var(--primary-white) !important;
    margin-bottom: 0.75rem;
    text-align: center;
}

.combinations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    justify-items: center;
}

/* Las cartas de combinaciones usan el mismo estilo que reset-card */
.combination-card .card-glyph {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

/* Estilos específicos para colores en combinaciones */
.combination-card.card-blue .card-top {
    background: linear-gradient(135deg, #4598ff 0%, #3580e6 100%) !important;
}

.combination-card.card-red .card-top {
    background: linear-gradient(135deg, #fd0202 0%, #cc0000 100%) !important;
}

.combination-card.card-green .card-top {
    background: linear-gradient(135deg, #00d084 0%, #00b370 100%) !important;
}

.combination-card.card-yellow .card-top {
    background: linear-gradient(135deg, #fee71c 0%, #fdd800 100%) !important;
}

.combination-card.card-orange .card-top {
    background: linear-gradient(135deg, #ff6b35 0%, #e6551c 100%) !important;
}

.combination-card.card-standard .card-top {
    background: var(--primary-white) !important;
}

.combination-card.card-standard .card-glyph {
    filter: brightness(0);
}

/* Responsive para combinaciones */
@media (max-width: 768px) {
    .combinations-section {
        padding: 1rem;
    }

    .combinations-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .combinations-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ==========================================================================
   UX IMPROVEMENTS - Visual Feedback
   ========================================================================== */

/* Estado activo para tecla Alt */
.key-alt.active {
    background: #b8b8b8 !important;
    opacity: 1 !important;
    box-shadow: 0 4px 0 #8a8a8a, 0 5px 12px rgba(0, 0, 0, 0.2) !important;
}

.key-alt.active .key-label {
    color: #2d2d2d !important;
    font-weight: 900;
}

/* Animación de pulso sutil */
@keyframes pulsate {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(0) scale(1.05);
    }
}

/* Estado seleccionado para teclas de color - hundida */
.key-color.selected {
    transform: translateY(4px);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* Indicador de color pendiente en el display */
.glyph-display.pending-color {
    position: relative;
}

.glyph-display.pending-color::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid transparent;
    border-radius: 8px;
    pointer-events: none;
    animation: borderPulse 1s ease-in-out infinite;
}

.glyph-display.pending-color-red::before {
    border-color: #fd0202;
}

.glyph-display.pending-color-blue::before {
    border-color: #4598ff;
}

.glyph-display.pending-color-green::before {
    border-color: #00d084;
}

.glyph-display.pending-color-yellow::before {
    border-color: #fee71c;
}

.glyph-display.pending-color-orange::before {
    border-color: #ff6b35;
}

@keyframes borderPulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* Etiqueta de color pendiente */
.color-pending-label {
    position: absolute;
    top: -12px;
    right: 10px;
    padding: 4px 12px;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-white);
    z-index: 10;
    animation: slideDown 0.3s ease-out;
}

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

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

/* Animación de entrada para glyphs en el display */
.display-glyph {
    animation: glyphEnter 0.3s ease-out;
}

@keyframes glyphEnter {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }

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

/* Feedback visual al presionar teclas */
.key.pressed {
    animation: keyPress 0.15s ease-out;
}

@keyframes keyPress {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(4px);
    }

    100% {
        transform: translateY(2px);
    }
}

/* ==========================================================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================================================== */

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

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-black);
    color: var(--primary-white);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

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

/* Focus visible styles for keyboard navigation */
.key:focus-visible {
    outline: 3px solid #4598ff;
    outline-offset: 3px;
    z-index: 10;
}

.key-color:focus-visible {
    outline: 3px solid var(--primary-white);
    outline-offset: 3px;
}

.key-special:focus-visible,
.key-glyph:focus-visible {
    outline: 3px solid #4598ff;
    outline-offset: 3px;
}

/* Better focus for navigation links */
.menu-container nav a:focus-visible {
    outline: 2px solid #4598ff;
    outline-offset: 2px;
    background-color: #f0f0f0;
}

/* Focus visible for color nodes */
.color-node:focus-visible {
    outline: 3px solid #4598ff;
    outline-offset: 4px;
    transform: scale(1.15);
}

/* Focus visible for cards */
.reset-card:focus-visible {
    outline: 3px solid #4598ff;
    outline-offset: 4px;
}

/* High contrast mode improvements */
@media (prefers-contrast: high) {
    .key {
        border: 2px solid #000;
    }

    .key-special {
        border: 3px solid #000;
    }

    .display-glyph {
        border: 2px solid #000;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {

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

    .key-alt.active {
        animation: none;
    }

    .key-color.selected {
        animation: none;
    }

    .glyph-display.pending-color::before {
        animation: none;
        opacity: 1;
    }

    .display-glyph {
        animation: none;
    }

    .color-pending-label {
        animation: none;
    }
}

/* Visual indicator for keyboard mode */
body.keyboard-mode .key:hover {
    transform: none;
    box-shadow: 0 4px 0 #c0c0c0, 0 5px 8px rgba(0, 0, 0, 0.15);
}

body.keyboard-mode .key:focus {
    transform: translateY(1px);
}

/* ==========================================================================
   DOCUMENTATION PAGE STYLES
   ========================================================================== */

/* Introduction Section */
.doc-intro {
    max-width: 800px;
    margin: 0 auto 4rem;
    background: var(--primary-white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.doc-intro h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d2d2d;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.doc-intro h2:first-child {
    margin-top: 0;
}

.doc-intro p {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #535353;
    margin-bottom: 1rem;
}

.doc-intro em {
    color: #2d2d2d;
    font-style: italic;
}

.doc-list {
    list-style: none;
    padding-left: 0;
    margin: 1rem 0 1.5rem 1.5rem;
}

.doc-list li {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #535353;
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: 0.5rem;
}

.doc-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #535353;
    font-weight: bold;
}

/* Ejes Section */
.ejes-section {
    max-width: 960px;
    margin: 0 auto;
}

.ejes-section h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #2d2d2d;
    text-align: center;
    margin-bottom: 1rem;
}

.ejes-intro {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #535353;
    text-align: center;
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Tabs Container */
.tabs-container {
    background: var(--primary-white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    width: 100%;
}

/* Tabs Navigation */
.tabs-nav {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    background: #f8f8f8;
    overflow-x: auto;
}

.tabs-nav::-webkit-scrollbar {
    height: 4px;
}

.tabs-nav::-webkit-scrollbar-track {
    background: #e0e0e0;
}

.tabs-nav::-webkit-scrollbar-thumb {
    background: #999;
    border-radius: 2px;
}

.tab-button {
    flex: 1;
    min-width: 60px;
    padding: 1.2rem 1rem;
    background: transparent;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 0;
    font-weight: 600;
    color: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Color squares for each tab */
.tab-button::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    /* Squares like Re(s)etario cards */
    background: #ccc;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.tab-button[data-color="gray"]::before {
    background: linear-gradient(135deg, #535353 0%, #2d2d2d 100%);
}

.tab-button[data-color="blue"]::before {
    background: linear-gradient(135deg, #4598ff 0%, #3580e6 100%);
}

.tab-button[data-color="green"]::before {
    background: linear-gradient(135deg, #00d084 0%, #00a869 100%);
}

.tab-button[data-color="yellow"]::before {
    background: linear-gradient(135deg, #fee71c 0%, #fdd800 100%);
}

.tab-button[data-color="red"]::before {
    background: linear-gradient(135deg, #fd0202 0%, #cc0000 100%);
}

.tab-button[data-color="orange"]::before {
    background: linear-gradient(135deg, #ff6b35 0%, #ff5722 100%);
}

.tab-button:hover {
    background: rgba(0, 0, 0, 0.03);
}

.tab-button:hover::before {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

/* Active tab states with colors */
.tab-button.active {
    font-weight: 700;
}

.tab-button.active::before {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5), 0 3px 8px rgba(0, 0, 0, 0.3);
}

.tab-button.active[data-tab="intro"] {
    border-bottom-color: #535353;
    background: rgba(83, 83, 83, 0.05);
}

.tab-button.active[data-tab="agua"] {
    border-bottom-color: #4598ff;
    background: rgba(69, 152, 255, 0.05);
}

.tab-button.active[data-tab="alimento"] {
    border-bottom-color: #00d084;
    background: rgba(0, 208, 132, 0.05);
}

.tab-button.active[data-tab="cobijo"] {
    border-bottom-color: #fdd800;
    background: rgba(254, 231, 28, 0.08);
}

.tab-button.active[data-tab="energia"] {
    border-bottom-color: #fd0202;
    background: rgba(253, 2, 2, 0.05);
}

.tab-button.active[data-tab="comunicacion"] {
    border-bottom-color: #ff6b35;
    background: rgba(255, 107, 53, 0.05);
}

/* Tab Content */
.tabs-content {
    padding: 2.5rem 2rem;
    min-height: 400px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.tab-panel h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #2d2d2d;
    margin-bottom: 2rem;
}

.eje-content h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d2d2d;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.eje-content h4:first-child {
    margin-top: 0;
}

.eje-content p {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #535353;
    margin-bottom: 1rem;
}

.ejes-list {
    list-style: none;
    padding-left: 0;
    margin: 1.5rem 0;
}

.ejes-list li {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    line-height: 1.9;
    color: #535353;
    padding-left: 1.8rem;
    position: relative;
    margin-bottom: 0.8rem;
}

.eje-list-item {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.eje-list-item:hover {
    opacity: 0.8;
}

.ejes-list li:before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #535353;
    border-radius: 2px;
}

.ejes-list li[data-color="blue"]:before {
    background: linear-gradient(135deg, #4598ff 0%, #3580e6 100%);
}

.ejes-list li[data-color="green"]:before {
    background: linear-gradient(135deg, #00d084 0%, #00a869 100%);
}

.ejes-list li[data-color="yellow"]:before {
    background: linear-gradient(135deg, #fee71c 0%, #fdd800 100%);
}

.ejes-list li[data-color="red"]:before {
    background: linear-gradient(135deg, #fd0202 0%, #cc0000 100%);
}

.ejes-list li[data-color="orange"]:before {
    background: linear-gradient(135deg, #ff6b35 0%, #ff5722 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .doc-intro {
        padding: 1.5rem;
    }

    .doc-intro h2 {
        font-size: 1.3rem;
    }

    .doc-intro p {
        font-size: 1rem;
    }

    .ejes-section {
        max-width: 100%;
        margin: 0;
    }

    .manual-section {
        max-width: 100%;
        margin: 0 0 3rem 0;
    }

    .ejes-section h2 {
        font-size: 1.6rem;
    }

    .ejes-intro {
        font-size: 1rem;
    }

    .tabs-container {
        width: 100%;
        border-radius: 8px;
        margin-left: -2rem;
        margin-right: -2rem;
        width: calc(100% + 4rem);
    }

    .manual-card {
        margin-left: -2rem;
        margin-right: -2rem;
        width: calc(100% + 4rem);
        border-radius: 0;
    }

    .tabs-nav {
        flex-direction: row;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .tab-button {
        min-width: 0;
        flex: 1;
        padding: 1.2rem 1rem;
        justify-content: center;
    }


    .tabs-content {
        padding: 1.5rem 1rem;
    }

    .tab-panel h3 {
        font-size: 1.5rem;
    }

    .eje-content h4 {
        font-size: 1.2rem;
    }

    .eje-content p {
        font-size: 1rem;
    }
}