* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #ff5722 0%, #e64a19 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1000px;
    width: 100%;
    position: relative;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 25px;
    font-size: 32px;
}

/* Story Box */
.story-box {
    background: linear-gradient(135deg, #ffe0b2 0%, #ffcc80 100%);
    border-left: 5px solid #e64a19;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.story-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.icon {
    font-size: 50px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.header-text strong {
    color: #bf360c;
    font-size: 20px;
    display: block;
}

.header-text p {
    color: #666;
    font-size: 14px;
    margin-top: 3px;
}

.story-text {
    color: #333;
    line-height: 1.8;
    font-size: 18px;
    text-align: center;
}

.story-text strong {
    color: #e64a19;
}

/* Equation Display */
.equation-display {
    text-align: center;
    font-size: 32px;
    font-weight: bold;
    color: #e64a19;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 20px;
    border-radius: 10px;
    margin: 25px 0;
    border: 3px solid #1976d2;
    font-family: 'Courier New', monospace;
}

/* Progress Display */
.progress-display {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #ff5722;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 5px solid #ff6f00;
}

#pointCount {
    color: #e64a19;
    font-size: 24px;
}

/* Plane Section */
.plane-section {
    margin: 30px 0;
    display: flex;
    justify-content: center;
}

.plane-wrapper {
    position: relative;
    background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
    border: 3px solid #ff5722;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 850px;
    width: 100%;
}

.plane-svg {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    background: white;
    cursor: crosshair;
}

.plane-svg.disabled {
    cursor: default;
    opacity: 0.7;
}

/* Plotted Point Styles */
.plotted-point {
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% { 
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.3);
    }
    100% { 
        transform: scale(1);
        opacity: 1;
    }
}

/* Draw Line Button */
.draw-line-btn {
    display: block;
    margin: 30px auto 20px;
    background: linear-gradient(135deg, #ff5722 0%, #e64a19 100%);
    color: white;
    border: none;
    padding: 15px 50px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 87, 34, 0.3);
}

.draw-line-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #e64a19 0%, #bf360c 100%);
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(255, 87, 34, 0.4);
}

.draw-line-btn:active {
    transform: translateY(0);
}

.draw-line-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Feedback */
.feedback {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    min-height: 30px;
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
}

.feedback.success {
    color: #4caf50;
    background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
}

.feedback.error {
    color: #f44336;
    background: linear-gradient(135deg, #ffcdd2 0%, #ef9a9a 100%);
}

.feedback.info {
    color: #2196f3;
    background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
}

/* Clapping Animation */
.clapping-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    display: none;
}

.clapping-container.active {
    display: block;
}

.clap {
    position: absolute;
    font-size: 60px;
    opacity: 0;
    animation: clap 2s ease-out forwards;
}

.clap:nth-child(1) { left: 10%; animation-delay: 0s; }
.clap:nth-child(2) { left: 20%; animation-delay: 0.2s; }
.clap:nth-child(3) { left: 30%; animation-delay: 0.4s; }
.clap:nth-child(4) { left: 40%; animation-delay: 0.6s; }
.clap:nth-child(5) { left: 50%; animation-delay: 0.8s; }
.clap:nth-child(6) { left: 60%; animation-delay: 1s; }
.clap:nth-child(7) { left: 70%; animation-delay: 1.2s; }
.clap:nth-child(8) { left: 80%; animation-delay: 1.4s; }
.clap:nth-child(9) { left: 90%; animation-delay: 1.6s; }
.clap:nth-child(10) { left: 15%; animation-delay: 1.8s; }

@keyframes clap {
    0% {
        bottom: -100px;
        opacity: 0;
        transform: scale(0.5) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) rotate(180deg);
    }
    100% {
        bottom: 120%;
        opacity: 0;
        transform: scale(0.8) rotate(360deg);
    }
}

/* Reset Button */
.reset-btn {
    display: block;
    margin: 20px auto;
    background: #4caf50;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: #388e3c;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.reset-btn:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 25px;
    }

    h1 {
        font-size: 26px;
    }

    .equation-display {
        font-size: 24px;
        padding: 15px;
    }

    .progress-display {
        font-size: 18px;
    }

    .plane-wrapper {
        padding: 15px;
    }

    .draw-line-btn {
        font-size: 16px;
        padding: 12px 40px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 22px;
    }

    .story-text {
        font-size: 16px;
    }

    .equation-display {
        font-size: 20px;
        padding: 12px;
    }

    .progress-display {
        font-size: 16px;
    }

    .clap {
        font-size: 40px;
    }
}
