/* リセット & 基本スタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.2rem;
    color: #7f8c8d;
}

/* セクション */
.section {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

/* カメラセクション */
.camera-container {
    position: relative;
    max-width: 640px;
    margin: 0 auto 2rem;
    border-radius: 15px;
    overflow: hidden;
    background: #f0f0f0;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#video, #canvas {
    width: 100%;
    height: auto;
    display: none;
    border-radius: 15px;
}

.capture-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    display: none;
    pointer-events: none;
}

/* ボタン */
.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    color: white;
}

.btn-secondary {
    background: #ecf0f1;
    color: #34495e;
}

.btn-capture {
    background: linear-gradient(45deg, #f39c12, #e74c3c);
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.icon {
    font-size: 1.2rem;
}

/* 分析セクション */
#analysisSection {
    text-align: center;
}

.loader {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 結果セクション */
.season-type {
    text-align: center;
    margin-bottom: 2rem;
}

.season-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

.season-type h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.season-type.spring { color: #ff6b6b; }
.season-type.summer { color: #4ecdc4; }
.season-type.autumn { color: #f39c12; }
.season-type.winter { color: #3498db; }

.color-info {
    margin-bottom: 2rem;
}

.color-info h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* カラーパレット */
.color-palette {
    margin-bottom: 2rem;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.color-item {
    height: 80px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.color-item:hover {
    transform: scale(1.1);
}

/* Tips */
.tips {
    text-align: left;
    margin-bottom: 2rem;
}

.tips h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.tips ul {
    list-style: none;
    padding-left: 0;
}

.tips li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.tips li:before {
    content: "✨";
    position: absolute;
    left: 0;
}

/* Info セクション */
.info h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.season-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.season-card {
    padding: 1.5rem;
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.season-card:hover {
    transform: translateY(-5px);
}

.season-card.spring {
    background: #ffe4e1;
    color: #d63031;
}

.season-card.summer {
    background: #e6f3ff;
    color: #0984e3;
}

.season-card.autumn {
    background: #ffeaa7;
    color: #d63031;
}

.season-card.winter {
    background: #dfe6e9;
    color: #2d3436;
}

.season-card h3 {
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    text-align: center;
    color: #7f8c8d;
    padding: 2rem 0;
}

/* レスポンシブ */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .section {
        padding: 1.5rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .color-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    }
    
    .color-item {
        height: 60px;
    }
}