/* ===== RC-505 Mobile - iPhone Optimized ===== */

@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@300;400;500;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #0a0a0c;
    --chassis: #1a1a1e;
    --surface: #222226;
    --surface-raised: #2a2a2e;
    --surface-inset: #151518;
    --border: #333;

    --boss-red: #e53935;
    --boss-orange: #ff7043;
    --boss-green: #43a047;
    --boss-blue: #1e88e5;
    --boss-yellow: #ffab00;

    --led-empty: #333;
    --led-recording: #ff1744;
    --led-playing: #00e676;
    --led-overdubbing: #ffab00;

    --text-label: #888;
    --text-bright: #ddd;
    --text-dim: #555;

    --font-mono: 'Roboto Mono', monospace;
    --font-ui: 'Inter', sans-serif;

    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

button {
    -webkit-appearance: none;
    appearance: none;
    font: inherit;
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: var(--bg);
    color: var(--text-bright);
    font-family: var(--font-ui);
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-text-size-adjust: 100%;
}

/* ===== Init Overlay ===== */
.init-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.init-box {
    background: var(--surface);
    border: 1px solid #444;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    width: 85%;
    max-width: 340px;
}

.init-box h2 {
    font-family: var(--font-mono);
    font-size: 22px;
    color: var(--boss-orange);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.init-box p {
    color: var(--text-label);
    font-size: 14px;
    margin-bottom: 28px;
    line-height: 1.6;
}

.init-note {
    margin-top: 16px;
    font-size: 11px;
    color: var(--text-dim);
}

.btn-start {
    width: 100%;
    padding: 16px;
    background: var(--boss-orange);
    border: none;
    border-radius: 12px;
    color: #000;
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 2px;
}

.btn-start:active { transform: scale(0.97); opacity: 0.9; }

/* ===== App Container ===== */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    overflow: hidden;
}

/* ===== Header ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: linear-gradient(180deg, #252528, #1e1e22);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.brand {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 14px;
    color: var(--text-bright);
    letter-spacing: 1px;
}

.brand span { color: var(--boss-orange); }

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.midi-status {
    font-family: var(--font-mono);
    font-size: 9px;
    color: #888;
    padding: 2px 6px;
    background: var(--surface-inset);
    border-radius: 4px;
    border: 1px solid #333;
    white-space: nowrap;
}
.midi-status.midi-ok {
    color: var(--boss-green);
    border-color: var(--boss-green);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-meter {
    width: 50px;
    height: 6px;
    border-radius: 3px;
}

.mic-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid #444;
    border-radius: 6px;
    color: var(--text-label);
    font-size: 11px;
    font-family: var(--font-mono);
}

.mic-btn.active { background: #1b2e1b; border-color: var(--boss-green); color: var(--led-playing); }

.mic-led {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--led-empty);
    transition: background 0.2s;
}

.mic-btn.active .mic-led { background: var(--led-playing); box-shadow: 0 0 6px var(--led-playing); }

/* ===== Track Tabs ===== */
.track-tabs {
    display: flex;
    gap: 2px;
    padding: 6px 8px;
    background: var(--chassis);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.track-tab {
    flex: 1;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-inset);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    transition: all 0.15s;
    position: relative;
}

.track-tab.active {
    background: var(--surface-raised);
    color: var(--text-bright);
    border-color: #555;
}

.track-tab[data-state="RECORDING"] { border-color: var(--led-recording); color: var(--led-recording); }
.track-tab[data-state="PLAYING"] { border-color: var(--led-playing); color: var(--led-playing); }
.track-tab[data-state="OVERDUBBING"] { border-color: var(--led-overdubbing); color: var(--led-overdubbing); }
.track-tab[data-state="STOPPED"] { border-color: var(--text-dim); color: var(--text-label); }

.track-tab::after {
    content: '';
    position: absolute;
    top: 4px; right: 4px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: transparent;
}

.track-tab[data-state="RECORDING"]::after { background: var(--led-recording); box-shadow: 0 0 4px var(--led-recording); }
.track-tab[data-state="PLAYING"]::after { background: var(--led-playing); }
.track-tab[data-state="OVERDUBBING"]::after { background: var(--led-overdubbing); }
.track-tab[data-state="STOPPED"]::after { background: var(--text-dim); }

/* ===== Track Display ===== */
.track-display {
    padding: 10px 12px;
    background: var(--surface);
    flex: 0 1 auto;
    overflow-y: auto;
    min-height: 0;
}

.track-waveform {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    background: var(--surface-inset);
    overflow: hidden;
    margin-bottom: 6px;
}

.track-waveform canvas {
    width: 100%;
    height: 100%;
}

.track-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.track-state-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.track-state-label[data-state="RECORDING"] { color: var(--led-recording); }
.track-state-label[data-state="PLAYING"] { color: var(--led-playing); }
.track-state-label[data-state="OVERDUBBING"] { color: var(--led-overdubbing); }

.track-time {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-label);
}

.track-meter {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    margin-bottom: 10px;
}

/* ===== Small Buttons (inline) ===== */
.small-buttons {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.btn-rec-play-sm {
    flex: 2;
    height: 40px;
    border: 2px solid #555;
    border-radius: 10px;
    background: linear-gradient(180deg, #3a3a3e, #2a2a2e);
    color: var(--text-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.btn-rec-play-sm .btn-icon { font-size: 14px; }
.btn-rec-play-sm .btn-label { font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: 1px; }
.btn-rec-play-sm:active { transform: scale(0.97); }

.btn-rec-play-sm[data-state="RECORDING"] { background: var(--led-recording); border-color: var(--led-recording); color: #fff; }
.btn-rec-play-sm[data-state="PLAYING"] { background: var(--led-playing); border-color: var(--led-playing); color: #000; }
.btn-rec-play-sm[data-state="OVERDUBBING"] { background: var(--led-overdubbing); border-color: var(--led-overdubbing); color: #000; }

.btn-stop-sm {
    flex: 1;
    height: 40px;
    border: 2px solid #444;
    border-radius: 10px;
    background: linear-gradient(180deg, #333, #252528);
    color: var(--text-label);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.btn-stop-sm .btn-icon { font-size: 14px; }
.btn-stop-sm .btn-label { font-family: var(--font-mono); font-size: 10px; }
.btn-stop-sm:active { transform: scale(0.97); background: #3a3a3e; }

/* ===== Voice FX Row ===== */
.voice-fx {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}
.vfx-btn {
    flex: 1 1 auto;
    min-width: 55px;
    padding: 5px 4px;
    border: 1px solid #444;
    border-radius: 6px;
    background: var(--surface-inset);
    color: var(--text-label);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.vfx-btn.active {
    background: var(--boss-blue);
    border-color: var(--boss-blue);
    color: #fff;
}

/* ===== Controls (Sliders) ===== */
.track-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.control-group {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    min-width: 28px;
    letter-spacing: 0.5px;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--surface-inset);
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(145deg, #666, #444);
    border: 2px solid #888;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.slider:active::-webkit-slider-thumb {
    background: linear-gradient(145deg, #888, #666);
    border-color: var(--boss-orange);
}

.slider-pan {
    background: linear-gradient(90deg, var(--surface-inset) 0%, var(--surface-inset) 47%, #555 49%, #555 51%, var(--surface-inset) 53%, var(--surface-inset) 100%);
}

/* ===== Bar Selector ===== */
.bar-selector {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}
.bar-selector label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    min-width: 32px;
}
.bar-btn {
    flex: 1;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-inset);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.1s;
}
.bar-btn:active { transform: scale(0.95); }
.bar-btn.active {
    background: var(--boss-orange);
    color: #000;
    border-color: var(--boss-orange);
}

/* ===== Track Actions ===== */
.track-actions {
    display: flex;
    gap: 6px;
}

.btn-action {
    flex: 1;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-inset);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-action:active { background: #2a2a2e; border-color: #555; color: var(--text-bright); }
.btn-action.active { background: var(--boss-blue); color: #fff; border-color: var(--boss-blue); }

/* ===== Section Tabs (FX / RHYTHM / MASTER in one row) ===== */
.section-tabs {
    display: flex;
    gap: 2px;
    padding: 4px 8px;
    background: var(--chassis);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.section-tab {
    flex: 1;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-inset);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
}
.section-tab.active {
    background: var(--boss-orange);
    color: #000;
    border-color: var(--boss-orange);
}

/* ===== Collapsible Sections ===== */
.sections {
    flex: 0 1 auto;
    overflow-y: auto;
    min-height: 0;
}

.section {
    border-bottom: 1px solid #222;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    background: var(--chassis);
    border: none;
    color: var(--boss-orange);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
}

.section-header.open { background: #1e1e22; }
.section-arrow { font-size: 10px; transition: transform 0.2s; }
.section-header.open .section-arrow { transform: rotate(180deg); }

.section-body {
    padding: 10px 12px;
    background: var(--surface);
}

/* ===== FX Section ===== */
.fx-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fx-group { }

.fx-title {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--boss-orange);
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.fx-banks {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.fx-bank {
    width: 32px; height: 28px;
    background: var(--surface-inset);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
}

.fx-bank.active { background: var(--boss-orange); color: #000; border-color: var(--boss-orange); }

.fx-slots {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fx-slot-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fx-slot-mobile select {
    flex: 1;
    padding: 8px 10px;
    background: var(--surface-inset);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-bright);
    font-family: var(--font-mono);
    font-size: 12px;
    appearance: none;
    -webkit-appearance: none;
}

.fx-slot-mobile select:focus { border-color: var(--boss-orange); outline: none; }

.fx-toggle-mobile {
    width: 44px; height: 32px;
    background: var(--surface-inset);
    border: 1px solid #444;
    border-radius: 6px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
}

.fx-toggle-mobile.active { background: var(--boss-green); color: #000; border-color: var(--boss-green); }

/* ===== Rhythm Section ===== */
.rhythm-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.rhythm-field {
    flex: 1;
    min-width: 0;
}

.rhythm-field label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.rhythm-field select {
    width: 100%;
    padding: 8px 10px;
    background: var(--surface-inset);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-bright);
    font-family: var(--font-mono);
    font-size: 12px;
    appearance: none;
    -webkit-appearance: none;
}

.rhythm-field select:focus { border-color: var(--boss-orange); outline: none; }

.bpm-field input {
    width: 100%;
    padding: 6px 8px;
    background: #0a0a0c;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--boss-orange);
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    -webkit-user-select: text;
    user-select: text;
}

.bpm-field input:focus { border-color: var(--boss-orange); outline: none; }

.btn-tap, .btn-rhythm-play {
    height: 38px;
    padding: 0 16px;
    border: 1px solid #444;
    border-radius: 8px;
    background: linear-gradient(180deg, #3a3a3e, #2a2a2e);
    color: var(--text-bright);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
}

.btn-tap:active, .btn-rhythm-play:active { transform: scale(0.97); }
.btn-rhythm-play.active { background: var(--boss-green); color: #000; border-color: var(--boss-green); }

.variation-btns {
    display: flex;
    gap: 4px;
}

.btn-var {
    width: 36px; height: 32px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-inset);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
}

.btn-var.active { background: var(--boss-blue); color: #fff; border-color: var(--boss-blue); }

.step-display {
    display: flex;
    gap: 3px;
    justify-content: center;
    padding: 4px 0;
}

.step-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #222;
    transition: background 0.05s;
}

.step-dot.active { background: var(--boss-orange); box-shadow: 0 0 4px var(--boss-orange); }
.step-dot.beat { background: #333; }

/* ===== Master Section ===== */
.master-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.master-row label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    min-width: 40px;
}

.master-meter {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    min-width: 100px;
}

.btn-monitor {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--surface-inset);
    border: 1px solid #444;
    border-radius: 8px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
}

.btn-monitor.active { background: #1b2e1b; border-color: var(--boss-green); color: var(--led-playing); }
.btn-monitor.active .mic-led { background: var(--led-playing); box-shadow: 0 0 6px var(--led-playing); }

.patch-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.patch-num {
    width: 50px;
    padding: 8px;
    background: #0a0a0c;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--boss-blue);
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    -webkit-user-select: text;
    user-select: text;
}

.patch-num:focus { border-color: var(--boss-blue); outline: none; }

.btn-patch {
    flex: 1;
    height: 36px;
    border: 1px solid #444;
    border-radius: 8px;
    background: linear-gradient(180deg, #333, #252528);
    color: var(--text-label);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
}

.btn-patch:active { background: #3a3a3e; color: var(--text-bright); }
.btn-danger { border-color: #633; color: #c66; }
.btn-danger:active { background: #411; }

/* ===== Notification ===== */
.notification {
    position: fixed;
    left: 50%; transform: translateX(-50%);
    bottom: calc(100px + var(--safe-bottom));
    padding: 10px 24px;
    background: #333;
    color: #fff;
    border-radius: 10px;
    font-family: var(--font-mono);
    font-size: 13px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

/* ===== Hidden ===== */
.hidden { display: none !important; }

/* ===== Recording pulse ===== */
@keyframes pulse-rec {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.btn-rec-play-sm[data-state="RECORDING"] .btn-icon,
.btn-rec-play-sm[data-state="OVERDUBBING"] .btn-icon {
    animation: pulse-rec 0.8s ease-in-out infinite;
}

/* ===== Instrument Section ===== */
.inst-top-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
}

.inst-select {
    flex: 1;
    padding: 6px 8px;
    background: var(--surface);
    color: var(--text-bright);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 12px;
}

.inst-vol-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
}
.inst-vol-inline label {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-label);
}
.inst-vol-inline .slider {
    flex: 1;
    min-width: 50px;
}

.inst-mode-btn {
    font-size: 10px !important;
    padding: 6px 8px !important;
    white-space: nowrap;
}

/* Section Labels */
.inst-section-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--boss-orange);
    letter-spacing: 1px;
    padding: 4px 8px 2px;
    font-weight: 600;
}

/* Progression Picker */
.prog-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 8px;
}

.prog-btn {
    padding: 6px 10px;
    background: var(--surface-inset);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-label);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    transition: all 0.1s;
}
.prog-btn.selected {
    background: var(--boss-blue);
    border-color: var(--boss-blue);
    color: #fff;
}
.prog-btn:active {
    transform: scale(0.95);
}

/* Progression Row (steps + play) */
.prog-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
}

.prog-steps {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
}

.prog-step {
    padding: 8px 12px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text-bright);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    min-width: 44px;
    transition: all 0.15s;
    cursor: pointer;
}
.prog-step.active {
    background: var(--boss-orange);
    border-color: var(--boss-orange);
    color: #000;
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(255,112,67,0.5);
}

.prog-arrow {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
}

.prog-play-btn {
    min-width: 60px;
    flex-shrink: 0;
    font-size: 12px !important;
    padding: 8px 12px !important;
}

/* Custom Chord Input */
.custom-prog-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
}
.custom-chord-input {
    flex: 1;
    padding: 8px 10px;
    background: var(--surface-inset);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-bright);
    font-family: var(--font-mono);
    font-size: 13px;
    outline: none;
    -webkit-user-select: text;
    user-select: text;
}
.custom-chord-input:focus {
    border-color: var(--boss-orange);
}
.custom-chord-input::placeholder {
    color: var(--text-dim);
    font-size: 11px;
}
.custom-set-btn {
    min-width: 44px;
    flex-shrink: 0;
    font-size: 11px !important;
    padding: 8px 10px !important;
    background: var(--boss-orange) !important;
    color: #000 !important;
    border-color: var(--boss-orange) !important;
}
.custom-play-btn {
    min-width: 50px;
    flex-shrink: 0;
    font-size: 11px !important;
    padding: 8px 10px !important;
}
.chord-hint {
    padding: 2px 8px 6px;
    font-family: var(--font-mono);
    font-size: 8px;
    color: var(--text-dim);
    line-height: 1.5;
    word-wrap: break-word;
    max-height: 36px;
    overflow-y: auto;
}

/* Chord Grid */
.chord-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 4px 8px 8px;
}

.chord-btn {
    padding: 14px 4px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 10px;
    color: var(--text-bright);
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
    transition: all 0.1s;
}
.chord-btn.basic {
    border-color: var(--boss-orange);
    color: var(--boss-orange);
}
.chord-btn.playing {
    background: var(--boss-orange);
    color: #000;
    transform: scale(0.95);
}
.chord-btn:active {
    background: var(--boss-orange);
    color: #000;
    transform: scale(0.95);
}

/* ===== Big Bottom REC/PLAY ===== */
.big-bottom {
    flex: 1 0 80px;
    display: flex;
    gap: 8px;
    padding: 6px 10px;
    background: var(--chassis);
    border-top: 1px solid var(--border);
}

.big-rec-btn {
    flex: 3;
    border: 3px solid #555;
    border-radius: 18px;
    background: linear-gradient(180deg, #3a3a3e, #2a2a2e);
    color: var(--text-bright);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.big-rec-btn:active { transform: scale(0.97); }

.big-rec-icon { font-size: 36px; line-height: 1; }
.big-rec-label { font-family: var(--font-mono); font-size: 16px; font-weight: 700; letter-spacing: 2px; }

/* Big button states */
.big-rec-btn[data-state="RECORDING"] {
    background: var(--led-recording);
    border-color: var(--led-recording);
    color: #fff;
    box-shadow: 0 0 40px rgba(255,23,68,0.5);
}
.big-rec-btn[data-state="PLAYING"] {
    background: var(--led-playing);
    border-color: var(--led-playing);
    color: #000;
    box-shadow: 0 0 40px rgba(0,230,118,0.5);
}
.big-rec-btn[data-state="OVERDUBBING"] {
    background: var(--led-overdubbing);
    border-color: var(--led-overdubbing);
    color: #000;
    box-shadow: 0 0 40px rgba(255,171,0,0.5);
}
.big-rec-btn[data-state="RECORDING"] .big-rec-icon,
.big-rec-btn[data-state="OVERDUBBING"] .big-rec-icon {
    animation: pulse-rec 0.8s ease-in-out infinite;
}

.big-side-btns {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.big-stop-btn {
    flex: 1;
    border: 2px solid #444;
    border-radius: 14px;
    background: linear-gradient(180deg, #333, #252528);
    color: var(--text-label);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.big-stop-btn:active { transform: scale(0.97); background: #3a3a3e; }

.big-del-btn {
    flex: 1;
    border: 2px solid #633;
    border-radius: 14px;
    background: linear-gradient(180deg, #2a1a1a, #1e1010);
    color: #c66;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.big-del-btn:active { transform: scale(0.97); background: #411; border-color: #944; color: #e88; }
