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

        body {
            font-family: "Arial", sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px;
        }

        .container {
            max-width: 600px;
            width: 100%;
            text-align: center;
        }

        .header {
            margin-bottom: 30px;
        }

        .header h1 {
            font-size: 3rem;
            margin-bottom: 15px;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
            background: linear-gradient(45deg, #fff, #f0f8ff);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .game-info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(10px);
            border-radius: 15px;
            padding: 15px;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .difficulty-selector select {
            background: rgba(255, 255, 255, 0.2);
            border: 1px solid rgba(255, 255, 255, 0.3);
            color: white;
            padding: 8px 15px;
            border-radius: 10px;
            font-size: 1rem;
            cursor: pointer;
        }

        .difficulty-selector select option {
            background: #333;
            color: white;
        }

        .timer {
            font-size: 1.2rem;
            font-weight: bold;
        }

        .controls {
            display: flex;
            gap: 10px;
            justify-content: center;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .btn {
            background: linear-gradient(45deg, #ff6b6b, #ee5a24);
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 20px;
            font-size: 0.9rem;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
        }

        .btn-secondary {
            background: linear-gradient(45deg, #74b9ff, #0984e3);
            box-shadow: 0 4px 15px rgba(116, 185, 255, 0.3);
        }

        .btn-secondary:hover {
            box-shadow: 0 6px 20px rgba(116, 185, 255, 0.4);
        }

        .sudoku-board {
            display: grid;
            grid-template-columns: repeat(9, 1fr);
            grid-template-rows: repeat(9, 1fr);
            gap: 1px;
            background: #333;
            border: 3px solid #333;
            border-radius: 10px;
            margin: 0 auto 20px;
            max-width: 450px;
            aspect-ratio: 1;
        }

        .sudoku-cell {
            background: white;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            font-weight: bold;
            color: #333;
            cursor: pointer;
            transition: all 0.2s ease;
            outline: none;
        }

        .sudoku-cell:nth-child(3n) {
            border-right: 2px solid #333;
        }

        .sudoku-cell:nth-child(n+19):nth-child(-n+27) {
            border-bottom: 2px solid #333;
        }

        .sudoku-cell:nth-child(n+46):nth-child(-n+54) {
            border-bottom: 2px solid #333;
        }

        .sudoku-cell.prefilled {
            background: #f8f9fa;
            color: #2c3e50;
            font-weight: 900;
            cursor: default;
        }

        .sudoku-cell.selected {
            background: #ffeaa7 !important;
            box-shadow: inset 0 0 0 2px #fdcb6e;
        }

        .sudoku-cell.highlighted {
            background: #ddd6fe !important;
        }

        .sudoku-cell.invalid {
            background: #ffcccc !important;
            color: #d63031 !important;
        }

        .sudoku-cell:hover:not(.prefilled) {
            background: #e1f5fe;
        }

        .number-input {
            display: flex;
            justify-content: center;
            gap: 5px;
            margin-bottom: 20px;
            flex-wrap: wrap;
        }

        .number-btn {
            width: 40px;
            height: 40px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            background: rgba(255, 255, 255, 0.1);
            color: white;
            border-radius: 10px;
            font-size: 1.2rem;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .number-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: scale(1.1);
        }

        .number-btn.active {
            background: rgba(255, 255, 255, 0.3);
            border-color: white;
        }

        .message {
            margin-top: 20px;
            padding: 15px;
            border-radius: 10px;
            font-size: 1.1rem;
            font-weight: bold;
            display: none;
        }

        .message.success {
            background: rgba(46, 204, 113, 0.2);
            border: 2px solid #2ecc71;
            color: #2ecc71;
            display: block;
        }

        /* Estilos del Modal de Instrucciones */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(5px);
            z-index: 1000;
            padding: 20px;
            box-sizing: border-box;
            overflow-y: auto;
        }

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

        .modal-content {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
            backdrop-filter: blur(20px);
            border-radius: 20px;
            max-width: 700px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            color: #333;
            animation: modalSlideIn 0.3s ease-out;
        }

        .back-button-container { margin-top: 30px; text-align: center; }
        

        @keyframes modalSlideIn {
            from {
                opacity: 0;
                transform: translateY(-30px) scale(0.95);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 25px 30px 20px;
            border-bottom: 2px solid rgba(103, 126, 234, 0.2);
        }

        .modal-header h2 {
            margin: 0;
            color: #667eea;
            font-size: 1.8rem;
        }

        .close-btn {
            background: none;
            border: none;
            font-size: 2rem;
            color: #999;
            cursor: pointer;
            padding: 0;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }

        .close-btn:hover {
            background: rgba(255, 0, 0, 0.1);
            color: #ff4757;
        }

        .modal-body {
            padding: 20px 30px;
        }

        .instruction-section {
            margin-bottom: 25px;
        }

        .instruction-section h3 {
            color: #667eea;
            margin-bottom: 15px;
            font-size: 1.3rem;
        }

        .instruction-section p {
            line-height: 1.6;
            margin-bottom: 10px;
        }

        .instruction-section ul {
            padding-left: 20px;
        }

        .instruction-section li {
            margin-bottom: 8px;
            line-height: 1.6;
        }

        .controls-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 15px;
            margin-top: 15px;
        }

        .control-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            background: rgba(103, 126, 234, 0.1);
            border-radius: 10px;
            border-left: 4px solid #667eea;
        }

        .control-icon {
            font-size: 1.5rem;
            width: 30px;
            text-align: center;
        }

        .visual-indicators {
            display: grid;
            gap: 12px;
        }

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

        .color-sample {
            width: 30px;
            height: 30px;
            border-radius: 6px;
            border: 2px solid #ddd;
        }

        .prefilled-sample {
            background: #f8f9fa;
        }

        .selected-sample {
            background: #ffeaa7;
            border-color: #fdcb6e;
        }

        .highlighted-sample {
            background: #ddd6fe;
        }

        .invalid-sample {
            background: #ffcccc;
            border-color: #ff7675;
        }

        .difficulty-info {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 15px;
            margin-top: 15px;
        }

        .difficulty-item {
            text-align: center;
            padding: 15px;
            background: rgba(103, 126, 234, 0.1);
            border-radius: 10px;
        }

        .difficulty-badge {
            display: inline-block;
            padding: 6px 15px;
            border-radius: 15px;
            font-weight: bold;
            font-size: 0.9rem;
            margin-bottom: 10px;
        }

        .difficulty-badge.easy {
            background: #00b894;
            color: white;
        }

        .difficulty-badge.hard {
            background: #e17055;
            color: white;
        }

        .modal-footer {
            padding: 20px 30px 30px;
            text-align: center;
            border-top: 2px solid rgba(103, 126, 234, 0.2);
        }
img {
  width: 5px;
  height: 30px;
  margin: 0 auto; /* Centra la imagen */
}


        @media (max-width: 768px) {
            .modal {
                padding: 10px;
            }

            .modal-content {
                max-height: 95vh;
            }

            .modal-header {
                padding: 20px 20px 15px;
            }

            .modal-header h2 {
                font-size: 1.5rem;
            }

            .modal-body {
                padding: 15px 20px;
            }

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

            .difficulty-info {
                grid-template-columns: 1fr;
            }

            .modal-footer {
                padding: 15px 20px 25px;
            }
        }

        @media (max-width: 768px) {
            .header h1 {
                font-size: 2rem;
            }

            .game-info {
                flex-direction: column;
                gap: 15px;
            }

            .controls {
                gap: 8px;
            }

            .btn {
                padding: 8px 16px;
                font-size: 0.8rem;
            }

            .sudoku-cell {
                font-size: 1rem;
            }

            .number-btn {
                width: 35px;
                height: 35px;
                font-size: 1rem;
            }
        }
