 <style>
        .content {
            display: flex;
            flex-wrap: wrap;
            gap: 30px;
            width: 100%;
            justify-content: center;
        }

        .diagram-container {
            background: white;
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            flex: 1;
            min-width: 300px;
            max-width: 600px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .diagram {
            width: 100%;
            height: 400px;
            background: linear-gradient(to bottom right, #e0f7fa, #b2ebf2);
            border-radius: 10px;
            display: flex;
            justify-content: center;
            align-items: center;
            margin-bottom: 20px;
            border: 2px solid #4CAF50;
        }

        .diagram-content {
            text-align: center;
            padding: 20px;
        }

        .diagram-content h3 {
            color: #1a2a6c;
            margin-top: 0;
        }

        .controls {
            background: rgba(255, 255, 255, 0.9);
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            flex: 1;
            min-width: 300px;
            max-width: 500px;
        }

        .controls h2 {
            color: #1a2a6c;
            margin-top: 0;
            text-align: center;
        }

        .math-dialog {
            display: none;
            position: fixed;
            z-index: 1000;
            width: auto;
            height: auto;
            background: transparent;
        }

        .dialog-content {
            background: rgba(244, 240, 236, 0.95);
            padding: 20px;
            border-radius: 15px;
            width: 90%;
            max-width: 500px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
            text-align: center;
            position: relative;
            border: 2px solid #4CAF50;
        }

        .dialog-header {
            background: rgba(76, 175, 80, 0.9);
            color: white;
            padding: 15px;
            margin: -20px -20px 20px -20px;
            border-radius: 15px 15px 0 0;
            font-size: 24px;
            font-weight: bold;
            cursor: move;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 2px solid #388E3C;
        }

        .close-btn {
            cursor: pointer;
            font-size: 1.8rem;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.2);
            transition: all 0.3s;
        }

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

        .math-text {
            font-size: 20px;
            margin: 20px 0;
            font-family: 'Arial', sans-serif;
            line-height: 1.6;
            color: #333;
        }

        .math-input {
            font-size: 20px;
            padding: 15px;
            width: 90%;
            margin: 20px 0;
            text-align: center;
            border: 2px solid #ccc;
            border-radius: 8px;
            transition: all 0.3s;
            background: rgba(255, 255, 255, 0.8);
        }

        .math-input:focus {
            border-color: #4CAF50;
            outline: none;
            box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
            background: white;
        }

        .dialog-buttons {
            display: flex;
            gap: 15px;
            justify-content: center;
            margin-top: 15px;
            flex-wrap: wrap;
        }

        .math-btn {
            box-shadow: 0 4px 8px rgba(64, 64, 64, 0.3);
            font-size: 18px;
            padding: 12px 25px;
            cursor: pointer;
            border: none;
            border-radius: 8px;
            background: #4CAF50;
            color: white;
            transition: all 0.3s;
            min-width: 120px;
            font-weight: bold;
        }

        .math-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 6px 12px rgba(64, 64, 64, 0.4);
        }

        .math-btn:active {
            transform: translateY(1px);
        }

        .math-btn.cancel {
            background: #f44336;
        }

        .math-btn.cancel:hover {
            background: #d32f2f;
        }

        .math-btn.reset {
            background: #f44336;
        }

        .math-btn.reset:hover {
            background: #d32f2f;
        }

        .math-btn.test {
            background: #4CAF50;
        }

        .math-btn.test:hover {
            background: #4CAF50;
        }

        .math-btn.stat {
            background: #2196F3;
        }

        .math-btn.stat:hover {
            background: #1976D2;
        }

        .math-btn.draw {
            background: #2196F3;
        }

        .math-btn.draw:hover {
            background: #1976D2;
        }


        .result-message {
            font-size: 20px;
            line-height: 1.6;
            padding: 15px;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.7);
            margin: 15px 0;
            border: 1px solid #ddd;
        }

        .instructions {
            background: rgba(255, 255, 255, 0.8);
            padding: 20px;
            border-radius: 15px;
            margin-top: 30px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
            max-width: 800px;
        }

        .instructions h3 {
            color: #1a2a6c;
            margin-top: 0;
            margin-bottom: 15px;
            text-align: center;
        }

        .instructions ul {
            padding-left: 20px;
            margin-bottom: 15px;
        }

        .instructions li {
            margin-bottom: 10px;
            line-height: 1.6;
            font-size: 1.1rem;
        }

        .instructions p {
            font-size: 1.1rem;
            line-height: 1.6;
            text-align: center;
            margin-top: 10px;
        }

        .btn-start {
            background: #FF9800;
            color: white;
            font-size: 1.2rem;
            padding: 14px 35px;
            border: none;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 6px 15px rgba(0,0,0,0.2);
            margin-top: 20px;
            font-weight: bold;
            letter-spacing: 1px;
        }

        .btn-start:hover {
            background: #F57C00;
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(0,0,0,0.3);
        }

        .drag-indicator {
            margin-right: 10px;
            font-size: 1.4rem;
            opacity: 0.8;
        }

        .stats-display {
            position: fixed;
            bottom: 20px;
            left: 20px;
            background: rgba(255, 255, 255, 0.9);
            padding: 15px;
            border-radius: 10px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.2);
            font-size: 16px;
            z-index: 500;
        }

        .stats-display div {
            margin: 5px 0;
        }

        .correct-stat {
            color: #4CAF50;
            font-weight: bold;
        }

        .wrong-stat {
            color: #f44336;
            font-weight: bold;
        }

        .skipped-stat {
            color: #2196F3;
            font-weight: bold;
        }

        @media (max-width: 768px) {
            .content {
                flex-direction: column;
                align-items: center;
            }

            .diagram-container, .controls {
                max-width: 100%;
            }

            .dialog-content {
                width: 95%;
            }

            .dialog-buttons {
                flex-direction: column;
                align-items: center;
            }

            .math-btn {
                width: 100%;
                max-width: 250px;
            }

            .stats-display {
                left: 50%;
                transform: translateX(-50%);
                bottom: 10px;
                width: 90%;
                text-align: center;
            }
        }
    </style>