/* ============================================================
   vocalight.css  —  VocaCapture
   フェーズ1リファクタリング: <style> ブロックより分離
   ============================================================ */

/* ── カラー変数 ─────────────────────────────── */
:root {
    --safe:      #4CAF50;
    --bg:        #1a1a1a;
    --accent:    #00d4ff;
    --error-red: #ff5252;
    --lo-on:     #29b6f6;
    --hi-on:     #ffb300;
    --sens-low:  #66bb6a;
    --sens-mid:  #ffa726;
    --sens-high: #ef5350;
    --btn-off:   #444;
}

/* ── ベース ─────────────────────────────────── */
body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background: #f0f2f5;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* ── ヘッダー ────────────────────────────────── */
.app-header {
    width: 100%;
    background: #ffffff;
    padding: 12px 20px;
    box-sizing: border-box;
    border-bottom: 2px solid #eeeeee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.header-main {
    display: flex;
    align-items: baseline;
}
.app-header .ver {
    color: #222;
    font-weight: 900;
    font-size: 19px;
    letter-spacing: -0.5px;
    margin-right: 12px;
}
.app-header .sub-title {
    color: #666;
    font-weight: bold;
    font-size: 14px;
    border-left: 1.5px solid #ddd;
    padding-left: 12px;
}

/* ── ヘルプボタン ────────────────────────────── */
#helpBtn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1.5px solid #ccc;
    background: #fff;
    color: #999;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
#helpBtn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── レイアウト ──────────────────────────────── */
.app-container {
    width: 98%;
    max-width: 1200px;
    padding: 8px;
    box-sizing: border-box;
}
.layer-label {
    font-size: 10px;
    color: #aaa;
    font-weight: 800;
    margin-bottom: 5px;
    padding-left: 4px;
    margin-top: 10px;
    letter-spacing: 1px;
}

/* ── ボタン群 ────────────────────────────────── */
.control-group {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}
.control-group button {
    flex: 1;
    padding: 14px 2px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
    color: white;
}
#readyBtn  { background: var(--safe); }
#stopBtn   { background: #333; }
#resumeBtn { background: var(--safe); }
#saveBtn  { background: #6c757d; }
#resetBtn   { background: #9c27b0; opacity: 0.6; }
#exitBtn   { background: #546e7a; }

/* ── コンディションボタン ───────────────────── */
.condition-group {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    padding: 8px;
    background: #e9ecef;
    border-radius: 12px;
}
.cond-btn {
    flex: 1;
    padding: 12px 2px;
    border: none;
    border-radius: 8px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    background: var(--btn-off);
    cursor: pointer;
}

/* ── ビジュアライザー ────────────────────────── */
.visualizer-container {
    position: relative;
    background: var(--bg);
    border-radius: 16px;
    overflow: hidden;
    height: 420px;
    box-shadow: inset 0 4px 12px rgba(0,0,0,0.5);
}
canvas {
    width: 100%;
    height: 100%;
    display: block;
}
#noteDisplay {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 6rem;
    font-weight: 900;
    color: white;
    pointer-events: none;
    opacity: 0;
    z-index: 10;
    text-shadow: 0 0 20px rgba(0,212,255,0.4);
}

/* ── ガイドラインオーバーレイ ───────────────── */
#guidelineOverlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    color: white;
    padding: 25px;
}
.guide-box {
    max-width: 500px;
    width: 100%;
}
.guide-section {
    margin-bottom: 22px;
    font-size: 14px;
    line-height: 1.6;
}
.guide-section h4 {
    margin: 0 0 10px 0;
    color: var(--safe);
    border-left: 4px solid var(--safe);
    padding-left: 10px;
    font-size: 15px;
}

/* ── ヘルプモーダル ──────────────────────────── */
#philosophyModal {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.98);
    display: none;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
    color: white;
    padding: 20px;
    overflow-y: auto;
}
.phil-container {
    max-width: 600px;
    width: 100%;
    margin: auto;
    padding-bottom: 40px;
    text-align: left;
}
.phil-category {
    font-size: 10px;
    color: #888;
    letter-spacing: 2px;
    margin-bottom: 5px;
}
.phil-section {
    margin-bottom: 30px;
    border-bottom: 1px solid #333;
    padding-bottom: 20px;
}
.phil-section h4 {
    margin: 0 0 15px 0;
    color: var(--safe);
    font-size: 18px;
    border-left: 4px solid var(--safe);
    padding-left: 12px;
}
.phil-section p,
.phil-section li {
    font-size: 14px;
    line-height: 1.7;
    color: #ccc;
    margin: 8px 0;
}
.phil-spec-box {
    background: #222;
    padding: 15px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 13px;
    color: #aaa;
    line-height: 1.6;
}
.close-btn {
    margin-top: 25px;
    padding: 12px 40px;
    background: var(--safe);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
}

/* ── 統計エリア ──────────────────────────────── */
#resultDefinition {
    display: none;
    font-size: 11px;
    color: #888;
    text-align: center;
    padding: 10px 0;
    font-weight: bold;
}
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}
.stat-card {
    background: white;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid #eee;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.label {
    font-size: 9px;
    color: #bbb;
    font-weight: 900;
    letter-spacing: 0.5px;
}
.value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #333;
}