/* =========================================
   LOCAL GAME STYLES: Chord Shapes
   ========================================= */

.controlsPanel {
    background: var(--bg-surface);
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-md);
    padding: 10px 10px;
    box-shadow: var(--shadow-soft);
}
body.light-theme .controlsPanel { border-color: rgba(0,0,0,0.06); }

.shapeViewerPanel, .questionPanel, .revealPanel {
    background: var(--bg-surface);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 12px 12px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 16px;
}

body.light-theme .shapeViewerPanel, 
body.light-theme .questionPanel, 
body.light-theme .revealPanel {
    border-color: rgba(0, 0, 0, 0.05);
}

.gameMainTitle {
    text-align: center;
    font-size: calc(22px * var(--font-scale));
    font-weight: 900;
    color: var(--text-main);
    margin: 0;
    padding-top: 10px;
    line-height: 0px;
}

/* Status Area */
.statusRow { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.statusText { text-align: center; width: 100%; background: var(--bg-base); padding: 16px; border-radius: var(--radius-sm); border: 2px solid rgba(255,255,255,0.05); }
.phaseTitle { font-size: calc(22px * var(--font-scale)); font-weight: 900; color: var(--text-main); margin-bottom: 6px; }
.feedbackLine { font-size: calc(16px * var(--font-scale)); color: var(--text-muted); min-height: 24px; font-weight: 500; }
.feedbackLine strong { color: #fff; font-weight: 800; background: var(--accent); padding: 2px 6px; border-radius: 6px;}

body.light-theme .statusText { border-color: rgba(0,0,0,0.05); }

/* Shape Viewer */
.shapeViewerTitle {
    font-size: calc(16px * var(--font-scale));
    font-weight: 800;
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.svgContainer {
    width: 100%;
    background: var(--bg-base);
    border: 2px solid var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.2);
}

#isolatedShapeSvg {
    width: 100%;
    max-width: 110px;
    height: auto;
    overflow: visible;
}

/* Intro modal titles */
.modalGameTitle {
    text-align: center; font-size: calc(22px * var(--font-scale)); font-weight: 900;
    margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px; line-height: 1.3;
}
.modalGameSubtitle {
    text-align: center; font-size: calc(16px * var(--font-scale)); font-weight: 700;
    color: var(--text-muted); margin-bottom: 10px;
}

/* Intro illustration */
.introIllustration { width: 100%; margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.introIllusPart { background: var(--bg-base); border: 2px solid var(--bg-elevated); border-radius: var(--radius-sm); padding: 10px 12px; }
.introIllusLabel { font-size: calc(12px * var(--font-scale)); font-weight: 800; color: var(--text-muted); text-align: center; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.3px; }
.introIllusMount { width: 100%; }
.introChordLabel { text-align: center; font-size: calc(13px * var(--font-scale)); font-weight: 800; color: var(--accent); margin-top: 6px; min-height: 18px; }

/* "Other shapes" section */
.introOtherHeading {
    font-size: calc(15px * var(--font-scale)); font-weight: 900; color: var(--text-main);
    margin: 20px 0 10px; text-align: left;
}
.introShapeCard {
    background: var(--bg-base); border: 2px solid var(--bg-elevated);
    border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px;
}
.introShapeCardRow {
    display: flex; gap: 10px; align-items: center; margin-bottom: 6px;
}
.introShapeCardDots { flex: 0 0 auto; }
.introShapeCardPiano { flex: 1 1 0; min-width: 0; }
.introShapeChordList {
    font-size: calc(11px * var(--font-scale)); font-weight: 700; color: var(--text-muted);
    line-height: 1.5; word-break: break-word;
}

/* Piano reference modal — no inner tile, SVG sits directly in the modalCard */
.pianoRefContainer {
    width: 100%;
    overflow-x: auto;
}
#pianoRefSvg {
    width: 100%;
    min-width: 320px;
    height: auto;
    display: block;
}

.finger-dot {
    fill: #10b981; /* Green dot */
    stroke: #047857;
    stroke-width: 2;
    filter: drop-shadow(0px 4px 4px rgba(0,0,0,0.4));
    transition: cx 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), cy 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Question counter — lives inside the shape viewer tile */
.questionCounter {
    text-align: center;
    font-size: calc(16px * var(--font-scale));
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* Question panel — tighter outer padding */
#questionPanel { padding: 8px 8px; }

/* Question instructions */
.questionInstructions {
    font-size: calc(14px * var(--font-scale));
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Inputs */
.inputGroup {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.inputGroup + .inputGroup { margin-top: 8px; }

.toggle-btn {
    flex: 1;
    background: var(--bg-base);
    color: var(--text-muted);
    border: 2px solid var(--bg-elevated);
    font-size: calc(14px * var(--font-scale));
    box-shadow: 0 4px 0 var(--bg-elevated);
    padding: 0 8px;
}

.toggle-btn.selected {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent-shadow);
    box-shadow: 0 4px 0 var(--accent-shadow);
    transform: translateY(2px);
}

#submitAnswerBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Reveal modal */
.revealModalCard { max-width: 560px; }

.revealModalDotsMount {
    width: 100%;
    max-width: 200px;
    margin: 0 auto 14px;
    background: var(--bg-base);
    border: 2px solid var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 8px;
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.2);
}

/* Reveal Area */
.revealFeedback {
    font-size: calc(16px * var(--font-scale));
    font-weight: 700;
    text-align: center;
    line-height: 1.5;
    margin-bottom: 20px;
    color: var(--text-main);
    padding: 12px;
    border-radius: var(--radius-sm);
}

.revealFeedback.correct {
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid var(--info-shadow);
}

.revealFeedback.incorrect {
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid var(--danger-shadow);
}

.chordTilesGrid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}

.chord-tile {
    background: var(--bg-base);
    border: 2px solid var(--bg-elevated);
    color: var(--text-main);
    font-weight: 800;
    font-size: calc(13px * var(--font-scale));
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    box-shadow: 0 3px 0 var(--bg-elevated);
    transition: all 0.1s;
}

.chord-tile:active {
    transform: translateY(3px);
    box-shadow: 0 0px 0 var(--bg-elevated);
}

.chord-tile.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent-shadow);
    box-shadow: 0 3px 0 var(--accent-shadow);
}

.pianoRevealContainer {
    width: 100%;
    background: var(--bg-base);
    border: 2px solid var(--bg-elevated);
    border-radius: var(--radius-sm);
    padding: 8px;
}

#pianoRevealSvg {
    width: 100%;
    height: auto;
    display: block;
}

/* Piano Key Styling */
.piano-key-w {
    fill: #ffffff;
    stroke: #cbd5e1;
    stroke-width: 2;
    transition: fill 0.3s;
}

.piano-key-b {
    fill: #0f172a;
    stroke: #000000;
    stroke-width: 2;
    transition: fill 0.3s;
}

.piano-key-w.highlighted {
    fill: #bfdbfe; /* Light blue highlight for white keys */
    stroke: #3b82f6;
}

.piano-key-b.highlighted {
    fill: #1e3a8a; /* Dark blue highlight for black keys */
    stroke: #60a5fa;
}

/* Actions */
.actionsRow { display: flex; gap: 8px; width: 100%; }
.actionsRow + .actionsRow { margin-top: 14px; margin-bottom: 2px; }
.actionsRow:first-child { margin-bottom: 0; }
.actionsRow .icon-btn      { flex: 0 0 calc(52px * var(--control-scale)); height: calc(52px * var(--control-scale)); padding: 0; font-size: calc(22px * var(--font-scale)); }
.actionsRow .flex-text-btn { flex: 1 1 0; padding: 0 4px; font-size: calc(13px * var(--font-scale)); white-space: nowrap; }
.actionsRow-top .icon-btn,
.actionsRow-top .flex-text-btn { flex: 1 1 0; }
.mainActionRow { display: flex; gap: 12px; }

/* Local coloured buttons */
.btn-teal2 {
    background: var(--active-teal);
    color: #fff;
    border: 2px solid var(--active-teal-shadow);
    box-shadow: 0 4px 0 var(--active-teal-shadow);
}
.btn-teal2:disabled { opacity: 0.4; box-shadow: none !important; cursor: not-allowed; transform: none !important; }
body.light-theme .btn-teal2  { box-shadow: 0 4px 0 var(--active-teal-shadow); }

.btn-purple {
    background: #a78bfa;
    color: #fff;
    border: 2px solid #7c3aed;
    box-shadow: 0 4px 0 #7c3aed;
}
.btn-purple:disabled { opacity: 0.4; box-shadow: none !important; cursor: not-allowed; transform: none !important; }
body.light-theme .btn-purple { box-shadow: 0 4px 0 #7c3aed; }

.btn-indigo {
    background: #6366f1;
    color: #fff;
    border: 2px solid #4338ca;
    box-shadow: 0 4px 0 #4338ca;
}
.btn-indigo:disabled { opacity: 0.4; box-shadow: none !important; cursor: not-allowed; transform: none !important; }
body.light-theme .btn-indigo { box-shadow: 0 4px 0 #4338ca; }

/* ── Coloured toggle buttons ── */
/* Major — blue */
.toggle-btn[data-val="Major"] {
    background: rgba(59, 130, 246, 0.12);
    border-color: #1d4ed8;
    color: var(--text-main);
    box-shadow: 0 4px 0 #1d4ed8;
}
.toggle-btn[data-val="Major"].selected {
    background: #3b82f6;
    color: #fff;
    border-color: #1d4ed8;
    box-shadow: 0 4px 0 #1d4ed8;
    transform: translateY(2px);
}

/* Minor — violet */
.toggle-btn[data-val="Minor"] {
    background: rgba(167, 139, 250, 0.12);
    border-color: #7c3aed;
    color: var(--text-main);
    box-shadow: 0 4px 0 #7c3aed;
}
.toggle-btn[data-val="Minor"].selected {
    background: #a78bfa;
    color: #fff;
    border-color: #7c3aed;
    box-shadow: 0 4px 0 #7c3aed;
    transform: translateY(2px);
}

/* Root Position — emerald */
.toggle-btn[data-val="Root"] {
    background: rgba(16, 185, 129, 0.12);
    border-color: #047857;
    color: var(--text-main);
    box-shadow: 0 4px 0 #047857;
}
.toggle-btn[data-val="Root"].selected {
    background: #10b981;
    color: #fff;
    border-color: #047857;
    box-shadow: 0 4px 0 #047857;
    transform: translateY(2px);
}

/* 1st Inversion — amber */
.toggle-btn[data-val="1st"] {
    background: rgba(245, 158, 11, 0.12);
    border-color: #b45309;
    color: var(--text-main);
    box-shadow: 0 4px 0 #b45309;
}
.toggle-btn[data-val="1st"].selected {
    background: #f59e0b;
    color: #fff;
    border-color: #b45309;
    box-shadow: 0 4px 0 #b45309;
    transform: translateY(2px);
}

/* 2nd Inversion — rose */
.toggle-btn[data-val="2nd"] {
    background: rgba(244, 63, 94, 0.12);
    border-color: #be123c;
    color: var(--text-main);
    box-shadow: 0 4px 0 #be123c;
}
.toggle-btn[data-val="2nd"].selected {
    background: #f43f5e;
    color: #fff;
    border-color: #be123c;
    box-shadow: 0 4px 0 #be123c;
    transform: translateY(2px);
}

/* Light-theme adjustments for toggle buttons */
body.light-theme .toggle-btn[data-val="Major"]          { color: #1d4ed8; }
body.light-theme .toggle-btn[data-val="Major"].selected { color: #fff; }
body.light-theme .toggle-btn[data-val="Minor"]          { color: #7c3aed; }
body.light-theme .toggle-btn[data-val="Minor"].selected { color: #fff; }
body.light-theme .toggle-btn[data-val="Root"]           { color: #047857; }
body.light-theme .toggle-btn[data-val="Root"].selected  { color: #fff; }
body.light-theme .toggle-btn[data-val="1st"]            { color: #b45309; }
body.light-theme .toggle-btn[data-val="1st"].selected   { color: #fff; }
body.light-theme .toggle-btn[data-val="2nd"]            { color: #be123c; }
body.light-theme .toggle-btn[data-val="2nd"].selected   { color: #fff; }

/* Next-shape inactive state mirrors next-note pattern */
.next-btn { background: var(--bg-base); color: var(--text-main); border: 2px solid var(--bg-elevated); box-shadow: 0 4px 0 var(--bg-elevated); }
.nextReady {
    background: var(--next-orange) !important; color: #fff !important;
    border-color: var(--next-shadow) !important; box-shadow: 0 4px 0 var(--next-shadow) !important;
    animation: ringPulse 1.5s ease-in-out infinite;
}

/* Score */
.analysis { padding: 0; background: transparent; border: none; box-shadow: none; }
.scoreCardNarrow { max-width: 100%; }
.analysisLabel { font-size: calc(18px * var(--font-scale)); font-weight: 900; color: var(--text-main); margin-top: 12px; margin-bottom: 12px; text-align: center; }
.scoreGrid { display: grid; gap: 8px; }
.scoreItem { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--bg-base); border-radius: var(--radius-sm); border: 2px solid var(--bg-elevated); }
.scoreK { font-size: calc(13px * var(--font-scale)); font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.scoreV { font-size: calc(20px * var(--font-scale)); font-weight: 900; }
.text-correct { color: var(--info-teal); }
.text-incorrect { color: var(--danger); }
.text-accent { color: var(--accent); }

.gameSubTitle {
    font-size: calc(20px * var(--font-scale));
    font-weight: 900;
    color: var(--text-main);
    margin-top: 0px;
    text-align: center;
}
/* --- Viewing-size: let control rows stack instead of overflowing --- */
.actionsRow, .inputGroup, .mainActionRow, .chordTilesGrid { flex-wrap: wrap; }
