:root {
    --primary: #FFC502;
    --bg-dark: #1E2227;
    --card-bg: #2a2f36;
    --text-white: #ffffff;
    --kb-black: #121417;
    --line-thickness: 2px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: 'Segoe UI', sans-serif;
    margin: 0; padding: 20px 10px;
    display: flex; flex-direction: column; align-items: center;
}

.app-container { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 15px; }

.header { display: flex; align-items: center; justify-content: space-between; padding: 0 5px; }
.back-btn { color: var(--primary); text-decoration: none; font-size: 13px; font-weight: 800; }
.main-title { font-size: 16px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; }

.main-card {
    background-color: var(--card-bg);
    border-radius: 24px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex; flex-direction: column; gap: 25px;
}

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.section-label { font-size: 10px; color: var(--primary); font-weight: 800; text-transform: uppercase; opacity: 0.8; }

.btn-help {
    width: 28px;
    height: 28px;
    background-color: rgba(255, 197, 2, 0.1); /* Amarelo bem sutil ao fundo */
    border: 1px solid var(--primary);         /* Borda com a sua cor amarela padrão */
    color: var(--primary);                    /* Cor do símbolo "?" */
    border-radius: 50%;                       /* Deixa o botão redondo */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100; /* Garante que ele fique "na frente" do teclado ou labels */
}

.btn-help:hover {
    background-color: var(--primary);
    color: #000;
}

.tonality-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.btn-ton { 
    background: var(--kb-black); border: 1px solid #444; color: white; 
    padding: 12px 0; border-radius: 8px; cursor: pointer; 
    font-size: 13px; font-weight: 800; 
}
.btn-ton.active { background: var(--primary); color: #1e2227; border-color: var(--primary); }

.degrees-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.degree-box { 
    background: var(--kb-black); border: 1px solid #444; padding: 12px 2px; border-radius: 12px; 
    text-align: center; cursor: pointer; position: relative; min-height: 60px;
    display: flex; flex-direction: column; justify-content: center;
    transition: all 0.1s ease;
}
.degree-box.playing { border-color: var(--primary); background: rgba(255, 197, 2, 0.25); transform: scale(1.02); }

.deg-tag { font-size: 12px; color: var(--primary); font-weight: 800; margin-bottom: 2px; }
.chord-display { font-size: 15px; font-weight: bold; }

.sub-menu {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--card-bg); border: 1px solid var(--primary);
    border-radius: 10px; display: none; flex-direction: column; z-index: 10; overflow: hidden;
}
.sub-btn { flex: 1; background: none; border: none; color: white; font-size: 8px; font-weight: 800; border-bottom: 1px solid #444; cursor: pointer; text-transform: uppercase; }
.sub-btn:last-child { border: none; }
.sub-btn.selected { background: var(--primary); color: #000; }

.piano-box {
    position: relative; width: 100%; height: 75px;
    background-color: #000; padding: var(--line-thickness);
    border-radius: 4px; display: flex; gap: var(--line-thickness); box-sizing: border-box;
}
.kw { flex: 1; background: white; height: 100%; border-radius: 0 0 2px 2px; z-index: 1; }
.kb { 
    position: absolute; background: var(--kb-black); width: 4.2%; height: 55%; z-index: 2; border-radius: 0 0 3px 3px;
    border-left: 0.5px solid #000; border-right: 0.5px solid #000;
}
.kw.active { background-color: var(--primary) !important; }
.kb.active { background-color: var(--primary); outline: var(--line-thickness) solid var(--kb-black); z-index: 10; }

.piano-labels { display: flex; width: 100%; justify-content: space-between; margin-top: 5px; }
.note-lbl { font-size: 8px; color: #888; font-weight: bold; text-transform: uppercase; width: 100%; text-align: center; }

.transport-row { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; gap: 10px; }
.btn-play-toggle { background: var(--primary); border: none; width: 48px; height: 48px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.btn-play-toggle svg { fill: #1e2227; width: 22px; height: 22px; }

.bpm-selector { background: #121417; border: 1px solid #444; color: var(--primary); padding: 16px; border-radius: 10px; font-weight: bold; flex: 1; text-align: center; }
.btn-loop-toggle { background: #121417; border: 1px solid #444; color: #666; flex: 1; padding: 16px; border-radius: 10px; font-weight: 800; cursor: pointer; }
.btn-loop-toggle.active { color: var(--primary); border-color: var(--primary); }

.modal-overlay { display: none; position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); backdrop-filter: blur(8px); align-items: center; justify-content: center; }
.modal-content { background: var(--card-bg); padding: 40px 25px; border-radius: 24px; width: 75%; max-width: 310px; border: 1px solid var(--primary); }