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

body {
    font-family: Georgia, serif;
    background: linear-gradient(135deg, #F5F3E9 0%, #E8E4D6 100%);
    color: #2F1B14;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 2.5rem;
    color: #8B0000;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    color: #B8860B;
    font-style: italic;
    margin-bottom: 5px;
}

.historical-note {
    font-size: 0.9rem;
    color: #654321;
    background: rgba(184, 134, 11, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 10px;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    margin-bottom: 30px;
}

.canvas-container {
    position: relative;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

#canvas {
    display: block;
    width: 100%;
    height: auto;
    cursor: grab;
}

#canvas:active {
    cursor: grabbing;
}

.zoom-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
}

.zoom-controls button {
    background: rgba(47, 27, 20, 0.8);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.zoom-controls button:hover {
    background: rgba(47, 27, 20, 1);
}

.control-panel {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    height: fit-content;
}

.section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(184, 134, 11, 0.2);
}

.section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.section h3 {
    color: #8B0000;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.primary-btn {
    background: linear-gradient(135deg, #8B0000, #CD5C5C);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    width: 100%;
    margin-bottom: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(139, 0, 0, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(139, 0, 0, 0.4);
}

.primary-btn.recording {
    background: linear-gradient(135deg, #FF4500, #FF6347);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.secondary-btn {
    background: linear-gradient(135deg, #B8860B, #DAA520);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.secondary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(184, 134, 11, 0.3);
}

.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #8B0000;
}

select, input[type="range"] {
    width: 100%;
    padding: 8px;
    border: 2px solid #B8860B;
    border-radius: 5px;
    background: white;
    color: #2F1B14;
    font-family: inherit;
}

select:focus, input[type="range"]:focus {
    outline: none;
    border-color: #8B0000;
    box-shadow: 0 0 5px rgba(139, 0, 0, 0.3);
}

input[type="range"] {
    background: linear-gradient(to right, #B8860B, #DAA520);
    height: 8px;
    border-radius: 4px;
    padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #8B0000;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #8B0000;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.info-panel {
    background: rgba(184, 134, 11, 0.1);
    border-radius: 10px;
    padding: 15px;
}

.frequency-display, .amplitude-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.amplitude-bar {
    width: 120px;
    height: 15px;
    background: rgba(47, 27, 20, 0.2);
    border-radius: 7px;
    overflow: hidden;
    position: relative;
}

#amplitudeFill {
    height: 100%;
    background: linear-gradient(90deg, #B8860B, #8B0000);
    border-radius: 7px;
    transition: width 0.1s ease;
    width: 0%;
}

.historical-facts {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: 30px;
}

.historical-facts h3 {
    color: #8B0000;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.expandable-content {
    max-height: none;
    overflow: visible;
}

.expandable-content ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.expandable-content li {
    margin-bottom: 8px;
}

.expandable-content strong {
    color: #B8860B;
}

.fun-fact {
    background: rgba(255, 165, 0, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #FFA500;
    font-style: italic;
}

footer {
    text-align: center;
    padding: 20px;
    background: rgba(47, 27, 20, 0.9);
    color: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

footer a {
    color: #B8860B;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

footer a:hover {
    color: #DAA520;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .canvas-container {
        margin-bottom: 20px;
    }
    
    #canvas {
        max-width: 100%;
        height: auto;
    }
    
    .control-panel {
        order: -1;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .historical-note {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .section h3 {
        font-size: 1rem;
    }
    
    .primary-btn, .secondary-btn {
        font-size: 14px;
        padding: 10px 15px;
    }
}

/* Vintage texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 25% 25%, rgba(184, 134, 11, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(139, 0, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}