:root {
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --primary-color: #4a90e2;
    --accent-color: #ff6b6b;
    --text-main: #2c3e50;
    --text-sub: #7f8c8d;
    --grid-line: #e0e0e0;
}

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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

header {
    text-align: center;
    margin-bottom: 10px;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: var(--text-main);
}



main {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    border: 1px solid var(--grid-line);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

.tooltip {
    position: absolute;
    background: rgba(44, 62, 80, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    pointer-events: none;
    transform: translate(-50%, -120%);
    transition: opacity 0.2s;
    z-index: 10;
    white-space: nowrap;
}

.tooltip.hidden {
    opacity: 0;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
}

button:hover {
    background: #357abd;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(1px);
}

.legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-sub);
}

.dot {
    width: 12px;
    height: 12px;
    background-color: var(--accent-color);
    border-radius: 50%;
    display: inline-block;
}

.info-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.info-card h3 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.info-card ul {
    list-style-position: inside;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-sub);
}

/* 모바일 대응 */
@media (max-width: 600px) {
    .chart-wrapper {
        aspect-ratio: 1/1;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    button {
        width: 100%;
    }
}