/* ===== CSS変数：カラーパレット定義 ===== */
:root {
    --bg: #0a0a0f;
    --bg2: #12121a;
    --bg3: #1a1a26;
    --border: #2a2a40;
    --accent: #00d4ff;
    --accent2: #ff6b6b;
    --space-color: #f1c40f;
    --text: #e0e0f0;
    --text-dim: #606080;
    --success: #00ff88;
}

/* ===== リセット・基本設定 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 20px;
}

/* ===== メインコンテナ ===== */
.container {
    width: 100%;
    max-width: 960px;
}

/* ===== タイトル ===== */
h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4em;
    font-weight: 900;
    text-align: center;
    color: var(--accent);
    letter-spacing: 0.1em;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
}

/* ===== コントロールパネル ===== */
.controls {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ===== ファイル選択ボタン ===== */
.file-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75em;
    padding: 10px 20px;
    border-radius: 6px;
    border: 1px solid var(--accent);
    cursor: pointer;
    background: transparent;
    color: var(--accent);
    letter-spacing: 0.05em;
    transition: all 0.2s;
    white-space: nowrap;
}
.file-label:hover {
    background: rgba(0, 212, 255, 0.1);
}
input[type="file"] { display: none; }

/* ===== ファイル名表示 ===== */
#fileName {
    color: var(--text-dim);
    font-size: 0.85em;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#fileName.loaded { color: var(--success); }

/* ===== スタートボタン ===== */
#startButton {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75em;
    padding: 10px 24px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background: var(--accent);
    color: var(--bg);
    font-weight: 700;
    letter-spacing: 0.05em;
    transition: all 0.2s;
    white-space: nowrap;
}
#startButton:hover:not(:disabled) {
    background: #33ddff;
    transform: translateY(-1px);
}
#startButton:disabled {
    background: var(--border);
    color: var(--text-dim);
    cursor: not-allowed;
}
#startButton.recording {
    background: var(--accent2);
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ===== 再生時間表示 ===== */
#timeDisplay {
    font-family: 'Orbitron', sans-serif;
    font-size: 1em;
    color: var(--accent);
    min-width: 80px;
    text-align: right;
}

/* ===== レーン表示エリア ===== */
.lanes-wrapper {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}

.lanes-label {
    font-size: 0.75em;
    color: var(--text-dim);
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: 0.1em;
}

/* ===== 11レーン横並び ===== */
.lanes-display {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 6px;
}

/* ===== 各レーン ===== */
.lane {
    flex: 1;
    min-width: 0;
    height: 80px;
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    transition: all 0.08s;
    background: var(--bg3);
    cursor: default;
}

/* ===== レーン番号 ===== */
.lane-num {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85em;
    font-weight: 700;
    color: var(--text-dim);
    transition: color 0.08s;
}

/* ===== キー名 ===== */
.lane-key {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7em;
    color: var(--text-dim);
    transition: color 0.08s;
}

/* ===== スペースキー（中央・目立つ色） ===== */
.lane.space-lane {
    border-color: rgba(241, 196, 15, 0.3);
    min-width: 60px;
}
.lane.space-lane .lane-key {
    font-size: 0.55em;
}

/* ===== アクティブ状態（キーを押したとき） ===== */
.lane.active {
    transform: scale(1.05);
    border-color: var(--accent);
    background: rgba(0, 212, 255, 0.15);
}
.lane.active .lane-num { color: var(--accent); }
.lane.active .lane-key { color: var(--accent); }

.lane.space-lane.active {
    border-color: var(--space-color);
    background: rgba(241, 196, 15, 0.15);
}
.lane.space-lane.active .lane-num { color: var(--space-color); }
.lane.space-lane.active .lane-key { color: var(--space-color); }

/* ===== ノーツカウント表示 ===== */
.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 16px;
}
.stat-item {
    text-align: center;
}
.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4em;
    font-weight: 700;
    color: var(--accent);
}
.stat-label {
    font-size: 0.7em;
    color: var(--text-dim);
    margin-top: 2px;
}

/* ===== 出力エリア ===== */
.output-area {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
}

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

.output-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75em;
    color: var(--text-dim);
    letter-spacing: 0.1em;
}

/* ===== コピーボタン ===== */
#copyButton {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7em;
    padding: 6px 16px;
    border-radius: 4px;
    border: 1px solid var(--success);
    cursor: pointer;
    background: transparent;
    color: var(--success);
    letter-spacing: 0.05em;
    transition: all 0.2s;
}
#copyButton:hover {
    background: rgba(0, 255, 136, 0.1);
}

/* ===== テキストエリア ===== */
textarea {
    width: 100%;
    height: 220px;
    background: var(--bg);
    color: #00ff88;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.82em;
    padding: 14px;
    resize: vertical;
    line-height: 1.6;
}
textarea:focus { outline: none; border-color: var(--accent); }

/* ===== キー説明 ===== */
.key-guide {
    margin-top: 16px;
    padding: 14px;
    background: var(--bg3);
    border-radius: 6px;
    font-size: 0.75em;
    color: var(--text-dim);
    text-align: center;
    line-height: 1.8;
}
.key-guide span {
    font-family: 'Orbitron', sans-serif;
    color: var(--accent);
    font-size: 0.9em;
}
.key-guide .space-key {
    color: var(--space-color);
}
