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

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: linear-gradient(180deg, #7DD3D1 0%, #B8E896 100%);
            min-height: 100vh;
            padding: 15px;
            display: flex;
            flex-direction: column;
        }
        
        /* Solo eliminar scroll en pantallas grandes CON suficiente altura */
        @media (min-width: 1200px) and (min-height: 800px) {
            body {
                height: 100vh;
                overflow: hidden;
            }
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            flex-direction: column;
            flex: 1;
        }
        
        /* Solo altura fija en pantallas grandes con suficiente altura */
        @media (min-width: 1200px) and (min-height: 800px) {
            .container {
                height: 100%;
            }
        }

        .header {
            text-align: center;
            margin-bottom: 20px;
            flex-shrink: 0;
        }

        .header h1 {
            font-size: 2em;
            color: #2c3e50;
            margin-bottom: 10px;
            font-weight: 700;
        }

        .header p {
            color: #7f8c8d;
            font-size: 1.1em;
            line-height: 1.6;
            max-width: 600px;
            margin: 0 auto;
        }

        .progress-bar {
            display: flex;
            justify-content: center;
            align-items: center;
            margin-bottom: 25px;
            flex-shrink: 0;
        }

        .step {
            display: flex;
            flex-direction: column;
            align-items: center;
            margin: 0 30px;
            position: relative;
        }

        .step-number {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 1.2em;
            margin-bottom: 10px;
            transition: all 0.3s ease;
        }

        .step.active .step-number {
            background: #3498db;
            color: white;
            box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
        }

        .step.inactive .step-number {
            background: #ecf0f1;
            color: #bdc3c7;
        }

        .step.completed .step-number {
            background: #27ae60;
            color: white;
            box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
        }

        .step-label {
            font-size: 0.9em;
            color: #7f8c8d;
            text-align: center;
        }

        .step.active .step-label {
            color: #3498db;
            font-weight: 600;
        }

        .step.completed .step-label {
            color: #27ae60;
            font-weight: 600;
        }

        .step-connector {
            position: absolute;
            top: 25px;
            left: 100%;
            width: 60px;
            height: 2px;
            background: #ecf0f1;
            z-index: -1;
        }

        .step-connector.completed {
            background: #27ae60;
        }

        .main-content {
            background: transparent;
            border-radius: 20px;
            padding: 25px;
            box-shadow: none;
            margin-bottom: 15px;
            flex: 1;
            display: flex;
            flex-direction: column;
        }
        
        /* Solo ocultar overflow en pantallas grandes con suficiente altura */
        @media (min-width: 1200px) and (min-height: 800px) {
            .main-content {
                overflow: hidden;
            }
        }

        .section-title {
            text-align: center;
            font-size: 1.5em;
            color: #2c3e50;
            margin-bottom: 20px;
            font-weight: 600;
            flex-shrink: 0;
        }

        .character-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
            align-content: start;
        }
        
        /* Solo flex: 1 en pantallas grandes con suficiente altura */
        @media (min-width: 1200px) and (min-height: 800px) {
            .character-grid {
                flex: 1;
            }
        }

        .character-card {
            background: #f8f9fa;
            border: 2px solid #e9ecef;
            border-radius: 12px;
            padding: 12px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            height: 100%;
        }

        .character-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
            border-color: #3498db;
        }

        .character-image {
            width: 100%;
            aspect-ratio: 1/1;
            background: #fff;
            border-radius: 8px;
            margin: 0 auto 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            flex: 1;
        }

        .character-name {
            font-weight: 600;
            color: #2c3e50;
            font-size: 0.85em;
            flex-shrink: 0;
        }

        /* Estilo especial para personajes no disponibles */
        .character-card.unavailable {
            opacity: 0.6;
            background: #f8f9fa;
            border: 2px dashed #f39c12;
        }

        .character-card.unavailable:hover {
            transform: translateY(-2px); /* Efecto hover más sutil */
            box-shadow: 0 8px 20px rgba(243, 156, 18, 0.2);
            border-color: #e67e22;
        }

        .character-card.unavailable .character-name {
            color: #f39c12;
        }

        /* Estilos para la página de selección de tono de piel */
        .skin-tone-grid {
            display: flex;
            justify-content: center;
            gap: 60px;
            margin: 60px 0;
            flex-wrap: wrap;
        }

        .skin-tone-option {
            display: flex;
            flex-direction: column;
            align-items: center;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .skin-tone-option:hover {
            transform: translateY(-5px);
        }

        .skin-tone-circle {
            width: 120px;
            height: 120px;
            border-radius: 50%;
            margin-bottom: 20px;
            border: 3px solid transparent;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        }

        .skin-tone-circle:hover {
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        }

        .skin-tone-circle.selected {
            border-color: #3498db;
            box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.2);
        }

        .skin-tone-light {
            background: #f4d1ae;
        }

        .skin-tone-medium {
            background: #c49272;
        }

        .skin-tone-dark {
            background: #8b5a3c;
        }

        .skin-tone-label {
            font-size: 1.1em;
            font-weight: 600;
            color: #2c3e50;
        }

        .step-description {
            text-align: center;
            color: #7f8c8d;
            font-size: 1.1em;
            margin-bottom: 40px;
            line-height: 1.6;
        }

        .navigation {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-shrink: 0;
        }

        .nav-button {
            padding: 12px 25px;
            border: none;
            border-radius: 10px;
            font-size: 1em;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .nav-button.back {
            background: #ecf0f1;
            color: #7f8c8d;
        }

        .nav-button.back:hover {
            background: #d5dbdb;
        }

        .nav-button.next {
            background: #3498db;
            color: white;
            box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
        }

        .nav-button.next:hover {
            background: #2980b9;
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
        }

        .page {
            display: none;
            flex-direction: column;
        }

        .page.active {
            display: flex;
            flex-direction: column;
        }
        
        /* Solo configuraciones especiales en pantallas grandes con suficiente altura */
        @media (min-width: 1200px) and (min-height: 800px) {
            .page {
                flex: 1;
                overflow: hidden;
            }
        }

        /* Detectar dispositivos móviles por orientación portrait y ancho máximo */
        @media (orientation: portrait) and (max-width: 1200px), (max-width: 768px) {
            body {
                padding: 10px;
            }
            
            .character-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
            }
            
            .progress-bar {
                flex-wrap: wrap;
                margin-bottom: 15px;
            }
            
            .step {
                margin: 5px 10px;
            }
            
            .main-content {
                padding: 15px;
            }
            
            .character-card {
                padding: 8px;
            }
            
            .character-name {
                font-size: 0.75em;
            }
            
            .section-title {
                font-size: 1.3em;
                margin-bottom: 15px;
            }
            
            .header h1 {
                font-size: 1.8em;
                margin-bottom: 8px;
            }
            
            .header {
                margin-bottom: 15px;
            }
            
            .character-preview-container {
                flex-direction: column;
                text-align: center;
            }
            
            .character-preview {
                margin-bottom: 20px;
            }
        }

        /* Para móviles pequeños en portrait o pantallas muy pequeñas */
        @media (orientation: portrait) and (max-width: 600px), (max-width: 480px) {
            body {
                padding: 8px;
            }
            
            .character-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 8px;
                margin-bottom: 15px;
            }
            
            .character-card {
                padding: 8px;
                min-height: 120px;
            }
            
            .character-image {
                margin-bottom: 6px;
            }
            
            .character-name {
                font-size: 0.75em;
                line-height: 1.2;
            }
            
            .header {
                margin-bottom: 10px;
            }
            
            .header h1 {
                font-size: 1.6em;
                margin-bottom: 5px;
            }
            
            .header p {
                font-size: 0.9em;
                line-height: 1.4;
            }
            
            .section-title {
                font-size: 1.2em;
                margin-bottom: 15px;
            }
            
            .progress-bar {
                margin-bottom: 10px;
            }
            
            .step {
                margin: 5px 8px;
            }
            
            .step-number {
                width: 35px;
                height: 35px;
                font-size: 1em;
            }
            
            .step-label {
                font-size: 0.8em;
            }
            
            .main-content {
                padding: 12px;
                margin-bottom: 10px;
            }
        }
        
        /* Para dispositivos con pantallas anchas pero de poca altura como Nest Hub */
        @media (min-width: 900px) and (max-height: 700px) {
            body {
                padding: 10px;
            }
            
            .header {
                margin-bottom: 15px;
            }
            
            .header h1 {
                font-size: 1.8em;
                margin-bottom: 8px;
            }
            
            .header p {
                font-size: 0.95em;
                line-height: 1.4;
            }
            
            .progress-bar {
                margin-bottom: 15px;
            }
            
            .step-number {
                width: 40px;
                height: 40px;
                font-size: 1em;
            }
            
            .step-label {
                font-size: 0.85em;
            }
            
            .main-content {
                padding: 20px;
                margin-bottom: 10px;
            }
            
            .section-title {
                font-size: 1.3em;
                margin-bottom: 15px;
            }
            
            .character-grid {
                gap: 10px;
                margin-bottom: 15px;
            }
            
            .character-card {
                padding: 10px;
            }
            
            .character-name {
                font-size: 0.8em;
            }
        }
        
        /* Para iPhones y móviles de alta resolución en portrait */
        @media (orientation: portrait) and (min-width: 800px) and (max-width: 1400px) {
            body {
                padding: 12px;
            }
            
            .header {
                margin-bottom: 15px;
            }
            
            .header h1 {
                font-size: 1.8em;
                margin-bottom: 8px;
            }
            
            .header p {
                font-size: 1em;
                line-height: 1.5;
            }
            
            .progress-bar {
                margin-bottom: 20px;
            }
            
            .step {
                margin: 5px 12px;
            }
            
            .step-number {
                width: 40px;
                height: 40px;
                font-size: 1.1em;
            }
            
            .step-label {
                font-size: 0.85em;
            }
            
            .main-content {
                padding: 20px;
                margin-bottom: 15px;
            }
            
            .section-title {
                font-size: 1.4em;
                margin-bottom: 20px;
            }
            
            .character-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 15px;
                margin-bottom: 20px;
            }
            
            .character-card {
                padding: 15px;
                min-height: 180px;
            }
            
            .character-image {
                margin-bottom: 10px;
            }
            
            .character-name {
                font-size: 0.9em;
                line-height: 1.3;
            }
        }
        
        /* Para pantallas muy pequeñas como Galaxy Z Fold cerrado */
        @media (max-width: 350px) {
            body {
                padding: 5px;
            }
            
            .header h1 {
                font-size: 1.4em;
            }
            
            .header p {
                font-size: 0.85em;
            }
            
            .section-title {
                font-size: 1.1em;
            }
            
            .character-grid {
                gap: 6px;
            }
            
            .character-card {
                padding: 6px;
                min-height: 110px;
            }
            
            .character-name {
                font-size: 0.7em;
            }
            
            .main-content {
                padding: 10px;
            }
            
            .step-number {
                width: 30px;
                height: 30px;
                font-size: 0.9em;
            }
            
            .step-label {
                font-size: 0.75em;
            }
        }
        
        /* Para pantallas muy cortas independientemente del ancho */
        @media (max-height: 600px) {
            body {
                padding: 8px;
            }
            
            .header {
                margin-bottom: 10px;
            }
            
            .header h1 {
                font-size: 1.6em;
                margin-bottom: 5px;
            }
            
            .header p {
                font-size: 0.9em;
                line-height: 1.3;
            }
            
            .progress-bar {
                margin-bottom: 12px;
            }
            
            .step {
                margin: 3px 8px;
            }
            
            .step-number {
                width: 35px;
                height: 35px;
                font-size: 0.9em;
                margin-bottom: 5px;
            }
            
            .step-label {
                font-size: 0.8em;
            }
            
            .main-content {
                padding: 15px;
                margin-bottom: 8px;
            }
            
            .section-title {
                font-size: 1.2em;
                margin-bottom: 12px;
            }
            
            .character-grid {
                gap: 8px;
            }
            
            .character-card {
                padding: 8px;
            }
            
            .character-image {
                margin-bottom: 4px;
            }
            
            .character-name {
                font-size: 0.75em;
            }
        }
        
        /* Para pantallas extremadamente cortas */
        @media (max-height: 500px) {
            body {
                padding: 5px;
            }
            
            .header h1 {
                font-size: 1.4em;
                margin-bottom: 3px;
            }
            
            .header p {
                font-size: 0.85em;
            }
            
            .header {
                margin-bottom: 8px;
            }
            
            .progress-bar {
                margin-bottom: 8px;
            }
            
            .step-number {
                width: 30px;
                height: 30px;
                font-size: 0.8em;
                margin-bottom: 3px;
            }
            
            .step-label {
                font-size: 0.7em;
            }
            
            .main-content {
                padding: 12px;
                margin-bottom: 5px;
            }
            
            .section-title {
                font-size: 1.1em;
                margin-bottom: 10px;
            }
            
            .character-grid {
                gap: 6px;
            }
            
            .character-card {
                padding: 6px;
            }
            
            .character-name {
                font-size: 0.7em;
            }
        }

        /* Estilos para la página 3 - Preview del personaje */
        .character-preview-container {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 60px;
            margin: 40px 0;
        }

        .character-preview {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        #personaje-canvas {
            border: 3px solid #e9ecef;
            border-radius: 15px;
            background: #fff;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
            margin-bottom: 20px;
            /* Mejoras de calidad para el canvas - SIN pixelación */
            image-rendering: auto;
            image-rendering: -webkit-optimize-quality;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
            -webkit-transform: translateZ(0);
            transform: translateZ(0);
        }

        .character-info {
            max-width: 400px;
            text-align: left;
        }

        .character-info h3 {
            font-size: 1.8em;
            color: #2c3e50;
            margin-bottom: 15px;
            font-weight: 600;
        }

        .preview-description {
            color: #7f8c8d;
            font-size: 1.1em;
            line-height: 1.6;
            margin-bottom: 30px;
        }

        .design-button {
            background: #3498db;
            color: white;
            padding: 15px 30px;
            border: none;
            border-radius: 10px;
            font-size: 1.1em;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
        }

        .design-button:hover {
            background: #2980b9;
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
        }


 /* --- CÓDIGO PARA AÑADIR AL FINAL DE STYLES.CSS --- */

/* Hacemos que el contenedor de la imagen pueda tener capas */
.character-image {
    position: relative; /* Esencial para posicionar las capas dentro */
}

/* Posicionamos todas las imágenes en capas dentro del contenedor */
.character-image img {
    position: absolute; /* Permite que las imágenes se superpongan */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Mantiene la proporción de la imagen */
    /* Removido: propiedades que causaban pixelación */
    /* Mantenemos solo las optimizaciones de rendimiento que no afectan la calidad */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    /* Agregamos propiedades para MEJORAR la calidad en lugar de pixelar */
    image-rendering: auto; /* Permite suavizado automático */
    image-rendering: -webkit-optimize-quality; /* Safari - calidad óptima */
}
    