:root {
    /* カラーパレット */
    --bg-color: #03030c;
    --panel-bg: rgba(13, 13, 33, 0.7);
    --panel-bg-solid: rgba(13, 13, 33, 0.9);
    --border-color: rgba(60, 60, 120, 0.4);
    --text-color: #e0e0ed;
    --text-muted: #8fa0c0;
    --accent-summer: #ff6b8b;
    --accent-winter: #4d96ff;
    --glow-color: rgba(77, 150, 255, 0.3);

    /* タイポグラフィ */
    --font-family: 'Noto Sans JP', sans-serif;
    --font-display: 'Orbitron', sans-serif;

    /* トランジション */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* ============================================================
   1. リセット & グローバルスタイル
   ============================================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 10% 10%, rgba(20, 20, 60, 0.5) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(10, 30, 80, 0.4) 0px, transparent 50%);
    color: var(--text-color);
    font-family: var(--font-family);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================================
   2. レイアウト & ヘッダー
   ============================================================ */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

h1 {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 6vw, 2.5rem);
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(45deg, #a5c7f7, #ffd2e8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(165, 199, 247, 0.3);
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 5px;
    letter-spacing: 1px;
}

.main-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

/* ============================================================
   3. ビジュアライザ (Canvas 領域)
   ============================================================ */
.visualizer-container {
    position: relative;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
    aspect-ratio: 16/9;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    letter-spacing: 1px;
    font-weight: 500;
    pointer-events: none;
    z-index: 10;
}

/* ============================================================
   4. コントロールパネル & ボタン
   ============================================================ */
.controls-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nav-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.tab-btn {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.tab-btn:hover {
    background: rgba(60, 60, 120, 0.4);
    border-color: rgba(100, 150, 255, 0.6);
    box-shadow: 0 0 12px var(--glow-color);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(40, 60, 120, 0.8), rgba(20, 30, 70, 0.9));
    border-color: #5c9cff;
    box-shadow: 0 0 15px rgba(92, 156, 255, 0.4);
    font-weight: bold;
}

/* オプションパネル (トグル/季節ボタン) */
.options-panel {
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.toggle-btn {
    background: rgba(20, 20, 45, 0.6);
    border: 1px solid var(--border-color);
    color: #a0a0c0;
    padding: 12px 22px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn:hover {
    border-color: #8080a0;
}

.toggle-btn.active.summer {
    background: rgba(255, 107, 139, 0.2);
    border-color: var(--accent-summer);
    color: #ff9ebb;
    box-shadow: 0 0 10px rgba(255, 107, 139, 0.3);
}

.toggle-btn.active.winter {
    background: rgba(77, 150, 255, 0.2);
    border-color: var(--accent-winter);
    color: #9eccff;
    box-shadow: 0 0 10px rgba(77, 150, 255, 0.3);
}

/* 季節スライダーコンポーネント */
.season-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 280px;
    max-width: 540px;
}

.season-slider-wrapper {
    position: relative;
    width: 100%;
    padding: 8px 10px 24px 10px;
}

#season-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, 
        rgba(100, 200, 255, 0.4) 0%, 
        rgba(255, 107, 139, 0.6) 25%, 
        rgba(255, 180, 70, 0.5) 50%, 
        rgba(77, 150, 255, 0.6) 75%, 
        rgba(100, 200, 255, 0.4) 100%);
    outline: none;
    cursor: pointer;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 8px rgba(100, 150, 255, 0.2);
    transition: all var(--transition-fast);
}

#season-slider:hover {
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 14px rgba(100, 180, 255, 0.4);
}

#season-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffffff 0%, #70aaff 60%, #3060c0 100%);
    border: 2px solid #ffffff;
    box-shadow: 0 0 12px rgba(112, 170, 255, 0.9), 0 2px 6px rgba(0, 0, 0, 0.6);
    cursor: grab;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

#season-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.18);
    box-shadow: 0 0 18px rgba(140, 200, 255, 1), 0 2px 8px rgba(0, 0, 0, 0.8);
}

#season-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffffff 0%, #70aaff 60%, #3060c0 100%);
    border: 2px solid #ffffff;
    box-shadow: 0 0 12px rgba(112, 170, 255, 0.9), 0 2px 6px rgba(0, 0, 0, 0.6);
    cursor: grab;
}

.season-slider-ticks {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 2px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.season-tick {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    pointer-events: auto;
    user-select: none;
    transition: all var(--transition-fast);
    padding: 2px 4px;
    border-radius: 4px;
}

.season-tick:hover {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(140, 200, 255, 0.8);
    background: rgba(80, 120, 200, 0.2);
}

.season-tick.active {
    color: #ffd270;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 210, 112, 0.8);
}

/* ユーティリティ */
.hidden {
    display: none !important;
}

/* ============================================================
   5. 情報パネル & 説明カード
   ============================================================ */
.info-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.info-content h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #b5d0ff;
}

.info-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #c0c0d5;
}

.image-credit {
    margin-top: 8px;
    font-size: 0.75rem;
    color: #607090;
}

/* モバイル非対応ブラウザ用バックアップ */
@supports not (backdrop-filter: blur(12px)) {

    .visualizer-container,
    .info-panel,
    .tab-btn {
        background: var(--panel-bg-solid);
    }
}

/* ============================================================
   6. レスポンシブ対応
   ============================================================ */
@media (min-width: 768px) {
    .main-layout {
        flex-direction: column;
    }
}