:root {
    --primary-color: #4a5568;
    --secondary-color: #718096;
    --accent-color: #5a67d8;
    --bg-color: #f7fafc;
    --text-color: #2d3748;
    --canvas-bg: #ffffff;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

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

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-color), #9f7aea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--secondary-color);
}

main {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

#artCanvas {
    width: 100%;
    height: 400px;
    background: var(--canvas-bg);
    border-radius: var(--border-radius);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
    cursor: crosshair;
    margin-bottom: 20px;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), #9f7aea);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(90, 103, 216, 0.3);
}

.btn-secondary {
    background: var(--bg-color);
    color: var(--text-color);
    border: 2px solid var(--bg-color);
}

.btn-secondary:hover {
    background: white;
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.icon {
    width: 20px;
    height: 20px;
}

.info-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.breath-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: var(--border-radius);
}

.breath-circle {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, var(--accent-color), transparent);
    border-radius: 50%;
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.stats {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent-color);
}

.settings {
    background: var(--bg-color);
    padding: 25px;
    border-radius: var(--border-radius);
}

.settings h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.setting-item {
    display: grid;
    grid-template-columns: 150px 1fr auto;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.setting-item label {
    font-weight: 500;
}

.setting-item select,
.setting-item input[type="range"] {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    transition: var(--transition);
}

.setting-item select:focus,
.setting-item input[type="range"]:focus {
    outline: none;
    border-color: var(--accent-color);
}

input[type="range"] {
    -webkit-appearance: none;
    height: 6px;
    background: #e2e8f0;
    padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
}

footer {
    text-align: center;
    margin-top: 30px;
}

.language-selector {
    margin-bottom: 10px;
}

.language-selector select {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
}

footer p {
    color: var(--secondary-color);
    font-size: 0.875rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .info-panel {
        grid-template-columns: 1fr;
    }
    
    .setting-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a202c;
        --text-color: #e2e8f0;
        --canvas-bg: #2d3748;
        --primary-color: #cbd5e0;
        --secondary-color: #a0aec0;
    }
    
    main {
        background: #2d3748;
    }
    
    .breath-indicator,
    .settings {
        background: #1a202c;
    }
    
    .setting-item select,
    .setting-item input[type="range"],
    .language-selector select {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
}