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

:root {
    --bg-overlay: rgba(10, 15, 30, 0.55);
    --panel-bg: rgba(255, 255, 255, 0.07);
    --panel-border: rgba(255, 255, 255, 0.12);
    --accent: #6CB4EE;
    --accent-glow: rgba(108, 180, 238, 0.35);
    --text-primary: rgba(255, 255, 255, 0.88);
    --text-secondary: rgba(255, 255, 255, 0.55);
    --font: 'Zen Kurenaido', sans-serif;
}

/* ─── Mono Theme ─── */
[data-theme="mono"] {
    --bg-overlay: rgba(0, 0, 0, 0);
    --panel-bg: rgba(255, 255, 255, 0.04);
    --panel-border: rgba(255, 255, 255, 0.07);
    --accent: #999;
    --accent-glow: rgba(160, 160, 160, 0.15);
    --text-primary: rgba(255, 255, 255, 0.78);
    --text-secondary: rgba(255, 255, 255, 0.38);
}
[data-theme="mono"] body { background: #1a1a1a; }
[data-theme="mono"] #bg-image { display: none; }
[data-theme="mono"] #rain-canvas { display: none; }

/* Mono: 再生ボタン */
[data-theme="mono"] .play-btn {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: none;
}
[data-theme="mono"] .play-btn:active,
[data-theme="mono"] .play-btn.playing {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(160, 160, 160, 0.2);
}

/* Mono: バリアントボタン */
[data-theme="mono"] .variant-btn.active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}
[data-theme="mono"] .variant-btn.f-active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
}

/* Mono: チャンネル */
[data-theme="mono"] .channel.active .channel-icon {
    color: rgba(255, 255, 255, 0.7);
}

/* Mono: スライダー */
[data-theme="mono"] .slider-wrap input[type="range"]::-webkit-slider-thumb {
    background: #888;
    box-shadow: 0 0 6px rgba(160, 160, 160, 0.3);
}

/* Mono: マスター・ゆらぎスライダー */
[data-theme="mono"] .master-section {
    border-color: rgba(255, 255, 255, 0.06);
}

/* Mono: 立体音響・寝そべりボタン */
[data-theme="mono"] .spatial-btn.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

/* Mono: タイマー */
[data-theme="mono"] .timer-tab.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}
[data-theme="mono"] .timer-circle-ring {
    stroke: rgba(255, 255, 255, 0.15);
}
[data-theme="mono"] .timer-circle-progress {
    stroke: #888;
}
[data-theme="mono"] .timer-go-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}
[data-theme="mono"] .timer-go-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Mono: 呼吸モード */
[data-theme="mono"] .breathe-mode-btn.selected {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}
[data-theme="mono"] .breathe-start-btn {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

/* Mono: Sync・プリセット保存ボタン */
[data-theme="mono"] .preset-btn,
[data-theme="mono"] .sync-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Mono: モーダル */
[data-theme="mono"] .modal {
    background: #222;
    border-color: rgba(255, 255, 255, 0.08);
}

/* Mono: ローディング */
[data-theme="mono"] .loading-overlay {
    background: #1a1a1a;
}

/* Mono: タイマー分数ボタン */
[data-theme="mono"] .timer-preset-btn.selected,
[data-theme="mono"] .pom-work-btn.selected,
[data-theme="mono"] .pom-break-btn.selected {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
}

/* Mono: 呼吸 分数・モードボタン */
[data-theme="mono"] .breathe-preset-btn.selected {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
}
[data-theme="mono"] .breathe-mode-btn.selected {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
}
[data-theme="mono"] .breathe-start-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* Mono: タイマー開始/停止ボタン */
[data-theme="mono"] .timer-action-btn.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
}

/* Mono: アラーム選択ボタン */
[data-theme="mono"] .alarm-choice.selected {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
}
[data-theme="mono"] .alarm-choice:hover {
    border-color: rgba(255, 255, 255, 0.25);
}

/* Mono: 開始ボタン */
[data-theme="mono"] .timer-go-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}
[data-theme="mono"] .timer-go-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}
[data-theme="mono"] .timer-go-btn.active {
    background: rgba(200, 160, 160, 0.1);
    border-color: rgba(200, 160, 160, 0.2);
    color: rgba(200, 160, 160, 0.7);
}

/* ─── Forest Theme ─── */
[data-theme="forest"] {
    --accent: #7CB68A;
    --accent-glow: rgba(124, 182, 138, 0.35);
}
[data-theme="forest"] #bg-image {
    background: url('../image/back_2.jpg') center/cover no-repeat;
    filter: brightness(0.45) saturate(0.9);
}
[data-theme="forest"] #rain-canvas { display: none; }
[data-theme="forest"] .play-btn {
    background: rgba(124, 182, 138, 0.1);
    box-shadow: 0 0 20px rgba(124, 182, 138, 0.15);
}
[data-theme="forest"] .play-btn.playing {
    background: rgba(124, 182, 138, 0.2);
    box-shadow: 0 0 30px rgba(124, 182, 138, 0.35);
}
[data-theme="forest"] .variant-btn.active {
    background: rgba(124, 182, 138, 0.2);
}
[data-theme="forest"] .variant-btn.f-active {
    background: rgba(124, 182, 138, 0.4);
    box-shadow: 0 0 8px rgba(124, 182, 138, 0.35);
}

/* ─── Fire Theme ─── */
[data-theme="fire"] {
    --accent: #E09050;
    --accent-glow: rgba(224, 144, 80, 0.35);
}
[data-theme="fire"] #bg-image {
    background: url('../image/back_3.jpg') center/cover no-repeat;
    filter: brightness(0.5) saturate(0.85);
}
[data-theme="fire"] #rain-canvas { display: none; }
[data-theme="fire"] .play-btn {
    background: rgba(224, 144, 80, 0.1);
    box-shadow: 0 0 20px rgba(224, 144, 80, 0.15);
}
[data-theme="fire"] .play-btn.playing {
    background: rgba(224, 144, 80, 0.2);
    box-shadow: 0 0 30px rgba(224, 144, 80, 0.35);
}
[data-theme="fire"] .variant-btn.active {
    background: rgba(224, 144, 80, 0.2);
}
[data-theme="fire"] .variant-btn.f-active {
    background: rgba(224, 144, 80, 0.4);
    box-shadow: 0 0 8px rgba(224, 144, 80, 0.35);
}

/* ─── Ember Canvas ─── */
#ember-canvas {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

/* ─── Firefly Canvas ─── */
#firefly-canvas {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

/* ─── Theme Selector ─── */
.theme-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 0 20px;
}

.theme-selector-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-right: 4px;
}

/* ─── Rich Mode Button ─── */
.rich-mode-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, border-color 0.3s ease, color 0.3s ease, background 0.3s ease;
    margin-left: 4px;
    opacity: 0.5;
}

.rich-mode-btn svg {
    width: 13px;
    height: 13px;
}

.rich-mode-btn.active {
    opacity: 1;
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(108, 180, 238, 0.12);
}

.rich-mode-btn.disabled {
    opacity: 0.2;
    pointer-events: none;
    cursor: default;
}

.theme-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.theme-dot:hover {
    border-color: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
}

.theme-dot.active {
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.theme-dot[data-skin="blue"] {
    background: linear-gradient(135deg, #1a2540, #2a4060);
}

.theme-dot[data-skin="mono"] {
    background: #333;
}

.theme-dot[data-skin="forest"] {
    background: linear-gradient(135deg, #1a3020, #2a5035);
}

.theme-dot[data-skin="fire"] {
    background: linear-gradient(135deg, #3a2010, #6a3820);
}

/* ─── Spectrum Analyzer ─── */
.spectrum-wrap {
    display: none; /* デフォルト非表示（スマホ） */
}

.spectrum-wrap canvas {
    width: 100%;
    cursor: pointer;
    border-radius: 8px;
}

.spectrum-wrap.hidden canvas {
    opacity: 0;
}

.spectrum-wrap canvas {
    transition: opacity 0.4s ease;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: var(--font);
    color: var(--text-primary);
    background: #0a0f1e;
}

/* ─── Background ─── */
#bg-image {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: url('../image/back.jpg') center/cover no-repeat;
    filter: brightness(0.55) saturate(0.8);
}

#bg-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: var(--bg-overlay);
}

#rain-canvas {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

/* ─── Main Content ─── */
.app {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 5vh 20px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ─── Header ─── */
.header {
    text-align: center;
    margin-bottom: 24px;
    animation: fadeInDown 1.2s ease-out;
    flex-shrink: 0;
}

.header h1 {
    font-size: 2.6rem;
    font-weight: 400;
    letter-spacing: 0.35em;
    text-shadow: 0 0 40px var(--accent-glow), 0 2px 8px rgba(0, 0, 0, 0.5);
    margin-bottom: 8px;
    position: relative;
    display: inline-block;
}

.edition-badge {
    position: absolute;
    right: -32px;
    top: 12px;
    font-size: 0.55rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    opacity: 0.6;
    text-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    line-height: 1;
}

.header .subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    letter-spacing: 0.15em;
    margin-bottom: 6px;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Mixer Panel ─── */
.mixer-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 28px 32px;
    width: 100%;
    max-width: 420px;
    animation: fadeInUp 1s ease-out 0.3s both;
    flex-shrink: 0;
    text-align: center;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Sound Channel ─── */
.channel {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
    /* 追加：中身は左揃え */
}

.channel:last-of-type {
    border-bottom: none;
}

.channel-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    opacity: 0.6;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.channel-icon svg {
    width: 20px;
    height: 20px;
}

.channel.active .channel-icon {
    opacity: 1;
}

.channel-info {
    flex: 1;
    min-width: 0;
    position: relative;
}

.channel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

.channel-name {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 300;
    font-size: 0.78rem;
    color: var(--text-secondary);
    letter-spacing: 0.08em;
}

/* ─── Variant Selector ─── */
.variant-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.variant-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 0.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: var(--font);
}

@media (hover: hover) {
    .variant-btn:hover {
        border-color: var(--accent);
        color: var(--accent);
    }
}

.variant-btn.active {
    background: rgba(108, 180, 238, 0.2);
    border-color: var(--accent);
    color: var(--accent);
}

.variant-btn.f-btn {
    width: auto;
    padding: 0 6px;
    border-radius: 11px;
    font-size: 0.55rem;
    letter-spacing: 0.05em;
}

.variant-btn.f-active {
    background: rgba(108, 180, 238, 0.4);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 8px var(--accent-glow);
    animation: fBtnPulse 3s ease-in-out infinite;
}

@keyframes fBtnPulse {

    0%,
    100% {
        box-shadow: 0 0 4px var(--accent-glow);
        opacity: 0.65;
    }

    50% {
        box-shadow: 0 0 22px rgba(108, 180, 238, 0.65), 0 0 6px rgba(108, 180, 238, 0.9);
        opacity: 1;
    }
}

/* ─── Range Slider ─── */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: background 0.2s;
    touch-action: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

@media (hover: hover) {
    input[type="range"]::-webkit-slider-thumb:hover {
        transform: scale(1.25);
        box-shadow: 0 0 18px var(--accent-glow);
    }
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    border: none;
    cursor: pointer;
}

/* ─── Divider ─── */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--panel-border), transparent);
    margin: 12px 0;
}

/* ─── Master Volume ─── */
.master-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    text-align: left;
    position: relative;
}

/* マスター0リップル */
.master-ripple {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.master-ripple.active {
    opacity: 1;
}

.master-ripple::before,
.master-ripple::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    transform: translate(-50%, -50%) scale(1);
    animation: masterRipple 2.8s ease-out infinite;
    opacity: 0;
}

.master-ripple::after {
    animation-delay: 1.4s;
}

@keyframes masterRipple {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.55;
    }
    60% {
        opacity: 0.12;
    }
    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

/* 再生ボタンのリップル（初回訪問誘導） */
.play-btn-wrap {
    position: relative;
    display: inline-flex;
}

.play-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.play-ripple.active {
    opacity: 1;
}

.play-ripple::before,
.play-ripple::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    transform: translate(-50%, -50%) scale(1);
    animation: playRipple 3s ease-out infinite;
    opacity: 0;
}

.play-ripple::after {
    animation-delay: 1.5s;
}

@keyframes playRipple {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.45;
    }
    60% {
        opacity: 0.08;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.2);
        opacity: 0;
    }
}

/* スライダーのリップル（初回誘導） */
.slider-ripple {
    position: absolute;
    left: 9px;
    bottom: 7px;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.slider-ripple.active {
    opacity: 1;
}

.slider-ripple::before,
.slider-ripple::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    transform: translate(-50%, -50%) scale(1);
    animation: masterRipple 2.8s ease-out infinite;
    opacity: 0;
}

.slider-ripple::after {
    animation-delay: 1.4s;
}

.master-label {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 300;
    font-size: 0.74rem;
    color: var(--text-secondary);
    white-space: nowrap;
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.master-label svg {
    width: 16px;
    height: 16px;
}

/* ─── Controls Row ─── */
.controls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

/* ─── Play Button ─── */
.play-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: rgba(108, 180, 238, 0.1);
    color: var(--accent);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(108, 180, 238, 0.15);
    flex-shrink: 0;
}

@media (hover: hover) {
    .play-btn:hover {
        background: rgba(108, 180, 238, 0.2);
        box-shadow: 0 0 30px rgba(108, 180, 238, 0.3);
        transform: scale(1.08);
    }
}

.play-btn:active {
    transform: scale(0.95);
}

.play-btn svg {
    width: 24px;
    height: 24px;
}

.play-btn .spin {
    animation: iconSpin 1s linear infinite;
}

@keyframes iconSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.play-btn.playing {
    background: rgba(108, 180, 238, 0.2);
    box-shadow: 0 0 30px var(--accent-glow);
    animation: playGlow 2s ease-in-out infinite;
}

@keyframes playGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(108, 180, 238, 0.2);
    }

    50% {
        box-shadow: 0 0 40px rgba(108, 180, 238, 0.4);
    }
}

/* ─── Preset Buttons ─── */
.preset-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.preset-btn svg {
    width: 16px;
    height: 16px;
}

@media (hover: hover) {
    .preset-btn:hover {
        background: rgba(255, 255, 255, 0.12);
        color: var(--accent);
        border-color: var(--accent);
    }
}

/* ─── About Link Button ─── */
.listening-note {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.46);
    font-size: 0.68rem;
    line-height: 1.7;
    letter-spacing: 0.04em;
    text-align: center;
    animation: fadeInUp 1s ease-out 0.55s both;
}

.listening-note + .about-link {
    margin-top: 8px;
}

.about-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    padding: 8px 20px;
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.78rem;
    font-family: var(--font);
    letter-spacing: 0.08em;
    transition: all 0.3s ease;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.about-link svg {
    width: 14px;
    height: 14px;
}

@media (hover: hover) {
    .about-link:hover {
        background: rgba(108, 180, 238, 0.1);
        border-color: var(--accent);
        color: var(--accent);
    }
}

/* ─── Preset Modal ─── */
.modal-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: rgba(20, 25, 45, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 28px;
    width: 100%;
    max-width: 360px;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateY(12px);
    transition: transform 0.35s ease;
}

.modal-overlay.show .modal {
    transform: translateY(0);
}

.modal h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    letter-spacing: 0.1em;
    text-align: center;
}

.preset-list {
    list-style: none;
    margin-bottom: 16px;
}

.preset-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 4px;
}

@media (hover: hover) {
    .preset-item:hover {
        background: rgba(255, 255, 255, 0.08);
    }
}

.preset-hint {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.25);
    text-align: center;
    margin-bottom: 10px;
    letter-spacing: 0.06em;
}

.preset-item-name {
    font-size: 0.85rem;
    flex: 1;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

@media (hover: hover) {
    .preset-item-name:hover {
        background: rgba(108, 180, 238, 0.12);
        color: var(--accent);
    }
}

.preset-item-name:active {
    background: rgba(108, 180, 238, 0.2);
    color: var(--accent);
}

.preset-delete {
    background: none;
    border: none;
    color: rgba(255, 100, 100, 0.6);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

@media (hover: hover) {
    .preset-delete:hover {
        color: rgba(255, 100, 100, 1);
    }
}

.preset-delete svg {
    width: 14px;
    height: 14px;
}

.preset-empty {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 16px 0;
}

.modal-close {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.8rem;
    transition: all 0.2s;
}

@media (hover: hover) {
    .modal-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
    }
}

/* ─── Import Modal ─── */
.import-modal .modal {
    max-width: 340px;
}

.import-modal h3 {
    font-size: 0.95rem;
    margin-bottom: 14px;
    letter-spacing: 0.1em;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.import-modal h3 svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.import-description {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 14px;
    line-height: 1.5;
}

.import-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    margin-bottom: 12px;
}

.import-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.import-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(108, 180, 238, 0.15);
}

.import-action-btn {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--accent);
    border-radius: 10px;
    background: rgba(108, 180, 238, 0.08);
    color: var(--accent);
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    transition: all 0.25s;
    margin-bottom: 8px;
}

@media (hover: hover) {
    .import-action-btn:hover {
        background: rgba(108, 180, 238, 0.18);
        box-shadow: 0 0 16px rgba(108, 180, 238, 0.12);
    }
}

.import-error {
    font-size: 0.7rem;
    color: rgba(255, 100, 100, 0.8);
    text-align: center;
    margin-bottom: 8px;
    display: none;
}

.import-error.visible {
    display: block;
}

/* ─── Save Modal (shares import-modal styles) ─── */
.save-modal .modal {
    max-width: 340px;
}

.save-modal h3 {
    font-size: 0.95rem;
    margin-bottom: 14px;
    letter-spacing: 0.1em;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.save-modal h3 svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.save-count {
    font-size: 0.68rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 12px;
}

/* ─── Preset Item Enhanced ─── */
.preset-item-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.preset-move-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.preset-move-btn svg {
    width: 12px;
    height: 12px;
}

@media (hover: hover) {
    .preset-move-btn:hover {
        border-color: var(--accent);
        color: var(--accent);
    }
}

.preset-checkbox {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    flex-shrink: 0;
    margin-right: 8px;
    position: relative;
    transition: all 0.2s;
}

.preset-checkbox:checked {
    background: rgba(108, 180, 238, 0.25);
    border-color: var(--accent);
}

.preset-checkbox:checked::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 0.65rem;
}

.preset-export-selected-btn {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: rgba(108, 180, 238, 0.08);
    color: var(--accent);
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    transition: all 0.25s;
    margin-bottom: 8px;
}

@media (hover: hover) {
    .preset-export-selected-btn:hover {
        background: rgba(108, 180, 238, 0.18);
        box-shadow: 0 0 16px rgba(108, 180, 238, 0.12);
    }
}

/* ─── Toast ─── */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(20, 30, 50, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 10px 22px;
    color: var(--accent);
    font-family: var(--font);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ─── Footer ─── */
.footer {
    text-align: center;
    padding: 32px 14px 18px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

@media (hover: hover) {
    .footer a:hover {
        color: var(--accent);
    }
}

.footer-links {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 4px;
}

/* ─── Loading ─── */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: #0a0f1e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-text {
    font-size: 1.5rem;
    letter-spacing: 0.3em;
    animation: loadPulse 1.5s ease-in-out infinite;
}

@keyframes loadPulse {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

/* ─── Spatial Audio Section ─── */
.spatial-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
    margin-top: 2px;
    text-align: left;
}

.spatial-buttons {
    display: flex;
    gap: 4px;
    flex: 1;
    justify-content: flex-end;
}

.spatial-btn {
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

@media (hover: hover) {
    .spatial-btn:hover {
        border-color: var(--accent);
        color: var(--accent);
        background: rgba(108, 180, 238, 0.08);
    }
}

.spatial-btn.active {
    background: rgba(108, 180, 238, 0.2);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.lying-btn {
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    margin-left: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
}

@media (hover: hover) {
    .lying-btn:hover {
        border-color: var(--accent);
        color: var(--accent);
    }
}

.lying-btn.active {
    background: rgba(108, 180, 238, 0.2);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.lying-btn.disabled {
    opacity: 0.25;
    pointer-events: none;
    cursor: default;
}

.lying-btn svg {
    width: 13px;
    height: 13px;
}

/* ─── Mobile ─── */
@media (max-width: 480px) {
    .app {
        padding: 3vh 16px 20px;
    }

    .header h1 {
        font-size: 1.8rem;
        letter-spacing: 0.2em;
    }

    .header .subtitle {
        font-size: 0.8rem;
    }

    .header {
        margin-bottom: 16px;
    }

    .mixer-panel {
        padding: 20px 18px;
        border-radius: 16px;
    }

    .channel {
        gap: 10px;
        padding: 8px 0;
    }

    .channel-icon {
        width: 28px;
        height: 28px;
    }

    .channel-icon svg {
        width: 17px;
        height: 17px;
    }

    .play-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .preset-btn {
        width: 36px;
        height: 36px;
    }

    .controls-row {
        gap: 16px;
        margin-top: 16px;
    }

    .listening-note {
        margin-top: 12px;
        max-width: 280px;
        font-size: 0.64rem;
    }

    .about-link {
        margin-top: 14px;
        padding: 7px 16px;
        font-size: 0.72rem;
    }

    .listening-note + .about-link {
        margin-top: 7px;
    }
}

@media (max-height: 680px) {
    .app {
        padding: 2vh 16px 16px;
    }

    .header {
        margin-bottom: 12px;
    }

    .header h1 {
        font-size: 1.6rem;
    }

    .header .subtitle {
        font-size: 0.75rem;
    }

    .mixer-panel {
        padding: 14px 18px;
    }

    .channel {
        padding: 6px 0;
    }

    .divider {
        margin: 8px 0;
    }

    .controls-row {
        margin-top: 12px;
    }

    .about-link {
        margin-top: 10px;
    }
}

/* ─── Attention Styles ─── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Sync Section ─── */
.sync-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sync-btn-row {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.sync-btn-row .breathe-info-btn {
    position: absolute;
    right: -32px;
}

.sync-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    border: 1px solid rgba(108, 180, 238, 0.25);
    border-radius: 24px;
    background: rgba(108, 180, 238, 0.06);
    color: var(--accent);
    font-size: 0.8rem;
    font-family: inherit;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.sync-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(108, 180, 238, 0.15), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

@media (hover: hover) {
    .sync-btn:hover {
        background: rgba(108, 180, 238, 0.12);
        border-color: rgba(108, 180, 238, 0.45);
        box-shadow: 0 0 20px rgba(108, 180, 238, 0.1);
        transform: translateY(-1px);
    }

    .sync-btn:hover::before {
        opacity: 1;
    }
}

.sync-btn:active {
    transform: scale(0.97);
}

.sync-btn svg {
    width: 15px;
    height: 15px;
}

.sync-btn.syncing {
    pointer-events: none;
    opacity: 0.5;
}

/* ─── Sync Connection Overlay ─── */
.sync-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(5, 8, 18, 0);
    pointer-events: none;
    transition: background 0.8s ease;
}

.sync-overlay.active {
    background: rgba(5, 8, 18, 0.82);
    pointer-events: auto;
}

.sync-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.sync-overlay.active .sync-overlay-content {
    opacity: 1;
    transform: scale(1);
}

.sync-wave {
    width: 80px;
    height: 80px;
    position: relative;
}

.sync-wave-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    opacity: 0;
    animation: syncRingExpand 2s ease-out infinite;
}

.sync-wave-ring:nth-child(2) {
    animation-delay: 0.5s;
}

.sync-wave-ring:nth-child(3) {
    animation-delay: 1.0s;
}

.sync-wave-ring:nth-child(4) {
    animation-delay: 1.5s;
}

@keyframes syncRingExpand {
    0% {
        transform: scale(0.3);
        opacity: 0.7;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

.sync-wave-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--accent-glow);
    animation: syncDotPulse 1.5s ease-in-out infinite;
}

@keyframes syncDotPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 12px var(--accent-glow);
    }

    50% {
        transform: scale(1.3);
        box-shadow: 0 0 28px var(--accent-glow);
    }
}

.sync-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-align: center;
    line-height: 1.8;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.sync-message.visible {
    opacity: 1;
}

.sync-message .accent {
    color: var(--accent);
}

.sync-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.sync-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: syncParticleFloat 3s ease-in-out infinite;
}

@keyframes syncParticleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }

    20% {
        opacity: 0.6;
    }

    80% {
        opacity: 0.3;
    }

    100% {
        opacity: 0;
        transform: translateY(-120px) scale(1.2);
    }
}

@media (max-width: 480px) {
    .sync-btn {
        padding: 9px 18px;
        font-size: 0.75rem;
    }
}

/* ─── Thanks Button ─── */
.thanks-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border: 1px solid rgba(255, 140, 160, 0.3);
    border-radius: 20px;
    background: rgba(255, 140, 160, 0.06);
    color: rgba(255, 180, 190, 0.9);
    font-size: 0.78rem;
    font-family: inherit;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(8px);
    animation: thanksAppear 0.6s ease forwards;
}

@keyframes thanksAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (hover: hover) {
    .thanks-btn:hover {
        background: rgba(255, 140, 160, 0.12);
        border-color: rgba(255, 140, 160, 0.5);
        box-shadow: 0 0 16px rgba(255, 140, 160, 0.12);
    }
}

.thanks-btn:active {
    transform: none;
}

.thanks-btn.sent {
    pointer-events: none;
    animation: thanksDissolve 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes thanksDissolve {
    0% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-6px);
        filter: blur(4px);
    }
}

/* ─── Thanks Wrapper (smooth height) ─── */
.thanks-wrapper {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.thanks-wrapper.visible {
    max-height: 60px;
}

.thanks-wrapper.collapsing {
    max-height: 0;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Thanks Received Notice ─── */
.thanks-notice {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
    font-size: 0.7rem;
    color: rgba(255, 180, 190, 0.6);
    letter-spacing: 0.06em;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.thanks-notice.visible {
    display: flex;
    opacity: 1;
}

.thanks-notice .heart-icon {
    font-size: 0.75rem;
    line-height: 1;
}

@keyframes noticeGlow {
    0% {
        color: rgba(255, 180, 190, 0.6);
    }

    30% {
        color: rgba(255, 160, 180, 1);
    }

    100% {
        color: rgba(255, 180, 190, 0.6);
    }
}

.thanks-notice.pulse {
    animation: noticeGlow 1.2s ease;
}

/* ─── Heart Particles ─── */
.heart-particles-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
    z-index: 800;
    overflow: hidden;
}

.heart-particle {
    position: absolute;
    bottom: -20px;
    font-size: 16px;
    opacity: 0;
    animation: heartFloat var(--duration, 4s) ease-out forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes heartFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5) rotate(0deg);
    }

    8% {
        opacity: 0.6;
        transform: translateY(-30px) scale(0.85) rotate(-3deg);
    }

    50% {
        opacity: 0.45;
        transform: translateY(calc(-50vh)) scale(0.7) rotate(5deg);
    }

    100% {
        opacity: 0;
        transform: translateY(calc(-100vh - 30px)) scale(0.35) rotate(10deg);
    }
}

/* ═══════════════════════════════════════
   Timer & Pomodoro
   ═══════════════════════════════════════ */

/* ─── 2カラムレイアウト ─── */
.app-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    max-width: 780px;
    flex-shrink: 0;
}

@keyframes fadeInOnly {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.app-layout .mixer-panel {
    flex: 1;
    max-width: 420px;
}

/* ─── Left Column (Timer + Breathe) ─── */
.left-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 260px;
    min-width: 260px;
    flex-shrink: 0;
}

/* ─── Timer Panel ─── */
.timer-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 20px 20px;
    width: 100%;
    flex-shrink: 0;
    text-align: center;
    animation: fadeInUp 1s ease-out 0.3s both;
}

/* ─── Tabs ─── */
.timer-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 3px;
    margin-bottom: 20px;
}

.timer-tab {
    flex: 1;
    padding: 8px 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.timer-tab svg {
    width: 14px;
    height: 14px;
}

.timer-tab.active {
    background: rgba(108, 180, 238, 0.12);
    color: var(--accent);
    border: 1px solid rgba(108, 180, 238, 0.2);
}

/* ─── Circle Timer ─── */
.timer-circle-wrap {
    position: relative;
    width: 130px;
    height: 130px;
    margin: 0 auto 16px;
}

.timer-circle {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 4;
}

.timer-ring {
    fill: none;
    stroke: var(--accent);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.timer-ring.pom {
    stroke: #64c88c;
}

.timer-circle-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.timer-display {
    font-size: 1.6rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--text-primary);
}

.timer-status {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-top: 2px;
    transition: opacity 0.3s;
}

/* ─── Action Row (開始/停止) ─── */
.timer-action-row {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 14px;
}

.timer-action-btn {
    padding: 5px 16px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s;
}

.timer-action-btn.active {
    background: rgba(108, 180, 238, 0.12);
    color: var(--accent);
    border-color: rgba(108, 180, 238, 0.3);
}

/* ─── Preset Row ─── */
.timer-preset-row {
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.timer-preset-btn {
    padding: 4px 10px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.timer-preset-btn.selected,
.pom-work-btn.selected,
.pom-break-btn.selected {
    background: rgba(108, 180, 238, 0.12);
    color: var(--accent);
    border-color: rgba(108, 180, 238, 0.3);
}

/* ─── Custom Input ─── */
.timer-custom-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
}

.timer-custom-input {
    width: 60px;
    padding: 5px 8px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.85rem;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
}

.timer-custom-input::-webkit-inner-spin-button,
.timer-custom-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.timer-custom-input:focus {
    border-color: rgba(108, 180, 238, 0.4);
}

.timer-custom-unit {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ─── Notify Toggle ─── */
.timer-notify-row {
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.alarm-selector {
    display: flex;
    gap: 4px;
}

.alarm-choice {
    padding: 3px 8px;
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.2s;
}

.alarm-choice.selected {
    background: rgba(108, 180, 238, 0.12);
    color: var(--accent);
    border-color: rgba(108, 180, 238, 0.3);
}

.alarm-choice:hover {
    border-color: rgba(108, 180, 238, 0.4);
}

.timer-toggle-label {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 300;
    font-size: 0.7rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.timer-toggle-label input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 34px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 9px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.timer-toggle-label input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.timer-toggle-label input[type="checkbox"]:checked {
    background: rgba(108, 180, 238, 0.25);
    border-color: rgba(108, 180, 238, 0.4);
}

.timer-toggle-label input[type="checkbox"]:checked::after {
    left: 18px;
    background: var(--accent);
}

/* ─── Go Button ─── */
.timer-go-btn {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(108, 180, 238, 0.3);
    border-radius: 12px;
    background: rgba(108, 180, 238, 0.08);
    color: var(--accent);
    font-family: var(--font);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timer-go-btn:hover {
    background: rgba(108, 180, 238, 0.18);
}

.timer-go-btn.active {
    background: rgba(220, 140, 160, 0.15);
    border-color: rgba(220, 140, 160, 0.3);
    color: #d48a9e;
}

/* ─── Pomodoro Specific ─── */
.pom-phase {
    font-size: 0.65rem;
    color: var(--accent);
    margin-top: 2px;
    letter-spacing: 0.06em;
}

.pom-phase.break {
    color: #64c88c;
}

.pom-sessions {
    font-size: 0.68rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    min-height: 1em;
}

.pom-config-group {
    margin-bottom: 10px;
}

.pom-config-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.06em;
}

.pom-work-btn,
.pom-break-btn {
    padding: 4px 10px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pom-custom-input {
    width: 42px;
    padding: 4px 6px;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.75rem;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
}

.pom-custom-input::-webkit-inner-spin-button,
.pom-custom-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.pom-custom-input:focus {
    border-color: rgba(108, 180, 238, 0.4);
}

/* ─── Desktop: 2-column mixer ─── */
@media (min-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .app-layout {
        max-width: 1200px;
        position: relative;
        padding-left: 280px; /* 260px (left column) + 20px gap */
    }

    .app-layout .mixer-panel {
        max-width: 920px; /* 1200 - 280 */
        margin: 0;
    }

    .spectrum-wrap {
        display: block;
        padding: 16px 8px 8px;
        height: 64px;
    }

    .spectrum-wrap canvas {
        height: 48px;
    }


    /* 左カラム：ミキサーの高さに絶対配置で揃え、内部スクロール */
    .left-column {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(255,255,255,0.1) transparent;
    }

    /* ─── スクロールフェード効果（JSでクラス付与） ─── */
    .left-column.mask-bottom {
        -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 40px), transparent);
        mask-image: linear-gradient(to bottom, black calc(100% - 40px), transparent);
    }
    
    .left-column.mask-top {
        -webkit-mask-image: linear-gradient(to bottom, transparent, black 40px, black);
        mask-image: linear-gradient(to bottom, transparent, black 40px, black);
    }
    
    .left-column.mask-both {
        -webkit-mask-image: linear-gradient(to bottom, transparent, black 40px, black calc(100% - 40px), transparent);
        mask-image: linear-gradient(to bottom, transparent, black 40px, black calc(100% - 40px), transparent);
    }

    .left-column::-webkit-scrollbar {
        width: 4px;
    }

    .left-column::-webkit-scrollbar-track {
        background: transparent;
    }

    .left-column::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.1);
        border-radius: 2px;
    }

    #mute-warning {
        display: none !important;
    }
}

@media (min-width: 960px) {
    .mixer-channels {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2px 24px;
    }

    .mixer-channels .channel {
        border-bottom: none;
        padding: 8px 0;
    }

    .spectrum-wrap {
        grid-column: 2;
        padding: 8px 0 8px 46px;
    }

    .mixer-bottom {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 32px;
        align-items: center;
    }

    .mixer-actions {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px;
    }

    .mixer-actions .controls-row {
        margin-top: 0;
    }

    .mixer-actions .sync-section {
        margin-top: 0;
    }
}

/* ─── Mobile: Timer below mixer ─── */
@media (max-width: 767px) {
    .app-layout {
        flex-direction: column;
        align-items: center;
        max-width: 420px;
    }

    .left-column {
        width: 100%;
        min-width: unset;
        max-width: 420px;
        order: 2;
        display: contents;
    }

    .timer-panel {
        width: 100%;
        min-width: unset;
        max-width: 420px;
        order: 3;
    }

    .breathe-panel {
        width: 100%;
        max-width: 420px;
        order: 4;
    }

    .theme-selector {
        order: 5;
        width: 100%;
        max-width: 420px;
    }

    .app-layout .mixer-panel {
        order: 1;
    }
}
