.widget {
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--surface);
    max-width: 640px;
    margin: 0 auto;
    padding: 36px 32px 34px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: relative;
}

.widget-header h1 {
    font-size: 1.75rem;
    font-family: var(--font-display);
    letter-spacing: -0.015em;
    margin: 0 0 8px;
    color: var(--ink);
}

.widget-header p {
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.55;
    margin: 0;
}

.controls-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    text-align: left;
    flex-wrap: wrap;
    justify-content: center;
}

.field {
    flex: 1 1 170px;
    max-width: 270px;
}

.field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 6px;
}

.select-wrap {
    position: relative;
}

.select-wrap::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
}

.field select {
    width: 100%;
    appearance: none;
    padding: 11px 36px 11px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--ink);
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.field select:hover {
    background: var(--key-hover);
    border-color: var(--border-strong);
}

.field select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-soft);
}

.field.tempo-field {
    display: flex;
    flex-direction: column;
}

.field.tempo-field label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.field.tempo-field label span {
    color: var(--gold);
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.85rem;
}

.field input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 32px;
    background: transparent;
    cursor: pointer;
}

.field input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: var(--key-hover);
}

.field input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: var(--key-hover);
}

.field input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    margin-top: -6px;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.field input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.field input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.status-line {
    min-height: 20px;
    font-size: 0.84rem;
    margin: 6px 0 4px;
    color: var(--muted);
    font-weight: 500;
}

.status-line.status-error {
    color: var(--coral);
    font-weight: 600;
}

.player-controls {
    margin: 18px 0 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #deb05b 0%, #c28827 100%);
    color: #18150a;
    border: none;
    padding: 13px 26px;
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--radius-pill);
    box-shadow: 0 8px 20px -6px rgba(194, 136, 39, 0.55);
    transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.16s ease, filter 0.16s ease;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px -6px rgba(194, 136, 39, 0.7);
    filter: brightness(1.03);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary.is-playing {
    animation: btnPulsePlaying 1.1s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes btnPulsePlaying {
    0% {
        transform: scale(0.98);
        box-shadow: 0 4px 14px -2px rgba(194, 136, 39, 0.4), 0 0 0 0 rgba(194, 136, 39, 0.4);
    }
    100% {
        transform: scale(1.02);
        box-shadow: 0 10px 26px -4px rgba(194, 136, 39, 0.7), 0 0 0 10px rgba(194, 136, 39, 0);
    }
}

.btn-primary:disabled {
    background: var(--surface-subtle);
    color: var(--muted-light);
    box-shadow: none;
    cursor: wait;
    border: 1px solid var(--border);
}

.btn-dark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--ink);
    color: #fdfbf7;
    border: none;
    padding: 13px 26px;
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-pill);
    box-shadow: 0 8px 18px -8px rgba(23, 24, 34, 0.4);
    transition: transform 0.16s ease, background 0.16s ease;
}

.btn-dark:hover {
    transform: translateY(-2px);
    background: #282a39;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--ink);
    padding: 11px 20px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-ghost:hover {
    background: var(--key-hover);
    border-color: var(--border-strong);
}

.play-icon {
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 9px solid currentColor;
}

.pause-icon {
    display: inline-flex;
    gap: 4px;
    width: 12px;
}

.pause-icon::before,
.pause-icon::after {
    content: '';
    width: 4px;
    height: 13px;
    background: currentColor;
    display: block;
    border-radius: 1px;
}

.feedback-msg {
    min-height: 28px;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.feedback-msg.feedback-correct { color: var(--green); }
.feedback-msg.feedback-wrong   { color: var(--coral); }
.feedback-msg.feedback-partial { color: var(--coral); }

.intervals-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.interval-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    padding: 13px 8px 11px;
    font-family: inherit;
    color: var(--ink);
    cursor: pointer;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 4px rgba(23, 24, 34, 0.03);
    transition: background 0.15s ease, transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.interval-choice strong {
    font-size: 1.1rem;
    font-weight: 700;
}

.interval-choice small {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 500;
}

.interval-choice:hover:not(:disabled) {
    background: var(--surface);
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px -4px var(--gold-glow);
}

.interval-choice:active:not(:disabled) {
    transform: translateY(0);
}

.interval-choice:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.scale-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scale-choice {
    background: var(--key);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.scale-choice:hover:not(:disabled) {
    background: var(--key-hover);
    border-color: var(--gold-soft);
}

.scale-choice:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.scale-choice.is-correct {
    background: var(--green-soft);
    border-color: var(--green);
    color: var(--green);
    font-weight: 600;
}

.scale-choice.is-wrong {
    background: rgba(192, 57, 43, 0.08);
    border-color: var(--coral);
    color: var(--coral);
}

.puzzle-list {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fragment-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--key);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.fragment-card.is-correct {
    border-left-color: var(--green);
    background: var(--green-soft);
}

.fragment-card.is-wrong {
    border-left-color: var(--coral);
    background: rgba(192, 57, 43, 0.06);
}

.fragment-card.sortable-ghost {
    opacity: 0.4;
}

.fragment-card.sortable-chosen {
    box-shadow: 0 6px 16px -6px rgba(34, 36, 46, 0.25);
}

.drag-handle {
    cursor: grab;
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1;
    padding: 4px;
    touch-action: none;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.fragment-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gold-soft);
    color: var(--gold);
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.fragment-play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.fragment-play-btn:hover {
    background: var(--key-hover);
}

.fragment-label {
    flex: 1;
    text-align: left;
    font-size: 0.88rem;
    color: var(--muted);
}

.result-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.notation-fragment-card {
    padding: 8px 14px;
}

.fragment-notation {
    flex: 1;
    overflow-x: auto;
    display: flex;
    align-items: center;
    min-height: 92px;
    background: #fff;
    border-radius: 6px;
}

.fragment-notation svg {
    height: 92px;
    width: auto;
    max-width: none;
}

@media (max-width: 480px) {
    .notation-fragment-card {
        flex-wrap: wrap;
    }
    .fragment-notation {
        flex-basis: 100%;
        order: 3;
    }
}

.puzzle-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.subnav {
    display: inline-flex;
    justify-content: center;
    background: var(--surface-subtle);
    padding: 5px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    margin: 0 auto 24px;
    gap: 4px;
    flex-wrap: wrap;
    box-shadow: inset 0 1px 3px rgba(24, 26, 36, 0.03);
}

.subnav a {
    padding: 7px 18px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    border: none;
    transition: all 0.16s ease;
    text-decoration: none;
}

.subnav a:hover {
    background: rgba(24, 26, 36, 0.06);
    color: var(--ink);
}

.subnav a[aria-current="page"] {
    background: var(--ink);
    color: #fdfbf7;
    box-shadow: 0 2px 8px rgba(24, 26, 36, 0.18);
}

.task-line {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 4px 0 18px;
}

.note-builder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin: 0 0 22px;
}

.note-cursor {
    display: flex;
    align-items: center;
    gap: 14px;
}

.note-cursor-label {
    font-weight: 600;
    min-width: 92px;
    text-align: center;
}

.note-builder-controls {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
    justify-content: center;
}

.note-builder-letter {
    display: flex;
    align-items: center;
    gap: 14px;
}

.letter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-subtle);
    color: var(--ink);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-subtle);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.letter-btn:hover:not(:disabled) {
    background: var(--surface);
    border-color: var(--gold);
    transform: scale(1.05);
}

.letter-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.accidental-group {
    display: flex;
    gap: 8px;
}

.accidental-btn {
    min-width: 52px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--surface-subtle);
    color: var(--ink);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-subtle);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.accidental-btn:hover:not(:disabled) {
    background: var(--surface);
    border-color: var(--gold);
    transform: translateY(-1px);
}

.accidental-btn.is-active {
    background: var(--ink);
    color: #fdfbf7;
    border-color: var(--ink);
    box-shadow: 0 4px 12px rgba(24, 26, 36, 0.2);
}

.accidental-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.notation-container {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 10px;
    margin: 0 0 22px;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
    box-shadow: inset 0 1px 3px rgba(24, 26, 36, 0.02);
}

.notation-container svg {
    max-width: 100%;
    height: auto;
}

/* Klasy feedbacku nanoszone dynamicznie na elementy SVG wyrenderowane przez Verovio */
.notation-container g.note.note-feedback-correct,
.notation-container g.note.note-feedback-correct * {
    fill: var(--green) !important;
    stroke: var(--green) !important;
}

.notation-container g.note.note-feedback-wrong,
.notation-container g.note.note-feedback-wrong * {
    fill: var(--coral) !important;
    stroke: var(--coral) !important;
}

.notation-wrap {
    position: relative;
}

.gesture-layer {
    position: absolute;
    inset: 0;
    touch-action: none;
    cursor: grab;
}

.gesture-layer:active {
    cursor: grabbing;
}

.gesture-hint {
    font-size: 0.78rem;
    color: var(--muted);
    margin: -14px 0 18px;
}

.piano-keyboard-wrap {
    margin: 0 0 22px;
}

.piano-keyboard-mount {
    text-align: center;
}

.piano-keyboard-panel {
    overflow-x: auto;
    overflow-y: hidden;
    margin-top: 14px;
    padding: 14px 10px 10px;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-subtle);
}

.piano-keyboard-panel[hidden] {
    display: none;
}

.piano-keyboard {
    position: relative;
    margin: 0 auto;
}

.piano-white-key {
    position: absolute;
    top: 0;
    height: 170px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0 0 4px 4px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
}

.piano-black-key {
    position: absolute;
    top: 0;
    height: 108px;
    z-index: 2;
    box-sizing: border-box;
    background: var(--ink);
    border-radius: 0 0 3px 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 7px;
    gap: 2px;
}

.piano-white-key .piano-key-label {
    font-size: 0.8rem;
    color: var(--muted);
}

.piano-black-key .piano-key-label {
    font-size: 0.56rem;
    line-height: 1.2;
    color: #fdfbf6;
}

.echo-keyboard-wrap {
    margin: 0 0 22px;
    overflow-x: auto;
    overflow-y: hidden;
}

.echo-keyboard {
    position: relative;
    margin: 0 auto;
}

.echo-white-key {
    position: absolute;
    top: 0;
    height: 170px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0 0 4px 4px;
    cursor: pointer;
    padding: 0;
    transition: background 0.1s ease, transform 0.05s ease;
}

.echo-white-key:hover:not(:disabled) {
    background: var(--key-hover);
}

.echo-white-key:active:not(:disabled) {
    transform: translateY(2px);
}

.echo-black-key {
    position: absolute;
    top: 0;
    height: 108px;
    z-index: 2;
    box-sizing: border-box;
    background: var(--ink);
    border: none;
    border-radius: 0 0 3px 3px;
    cursor: pointer;
    padding: 0;
    transition: background 0.1s ease, transform 0.05s ease;
}

.echo-black-key:hover:not(:disabled) {
    background: #3a3d4a;
}

.echo-black-key:active:not(:disabled) {
    transform: translateY(2px);
}

.echo-white-key:disabled,
.echo-black-key:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.answer-trail {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0 0 18px;
}

.answer-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--key);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.answer-slot.is-filled  { border-color: var(--gold-soft); background: var(--gold-soft); }
.answer-slot.is-correct { border-color: var(--green); background: var(--green-soft); }
.answer-slot.is-wrong   { border-color: var(--coral); background: rgba(192, 57, 43, 0.08); }

/* -------------------------------------------------------------
   MODUŁ ŚPIEWU / SOLFEŻ / PITCH TRACKER
------------------------------------------------------------- */
.mic-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.76rem;
    font-weight: 600;
    background: var(--surface-subtle);
    color: var(--muted);
    border: 1px solid var(--border);
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.mic-status-badge.is-active {
    background: var(--green-soft);
    color: var(--green);
    border-color: var(--green);
    box-shadow: 0 0 0 1px var(--green);
}

.tuner-card {
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin: 14px 0 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.tuner-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    width: 100%;
    max-width: 380px;
}

.tuner-note {
    font-size: 1.85rem;
    font-weight: 800;
    font-family: var(--font-display);
    color: var(--ink);
    line-height: 1;
}

.tuner-solfege {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--muted);
    font-style: italic;
}

.tuner-status {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--muted);
    transition: color 0.15s ease;
}

.tuner-status.is-in-tune {
    color: var(--green);
}

.tuner-status.is-flat, .tuner-status.is-sharp {
    color: var(--gold);
}

.tuner-meter {
    position: relative;
    width: 100%;
    max-width: 380px;
    height: 10px;
    background: #e2dfd5;
    border-radius: 5px;
    overflow: visible;
}

.tuner-sweet-spot {
    position: absolute;
    top: 0;
    left: 35%;
    width: 30%;
    height: 100%;
    background: rgba(46, 125, 50, 0.25);
    border-radius: 4px;
}

.tuner-center-mark {
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 18px;
    background: var(--green);
    border-radius: 1px;
    z-index: 2;
}

.tuner-indicator {
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gold);
    border: 2.5px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: left 0.08s ease-out;
    z-index: 3;
}

.tuner-hold-track {
    width: 100%;
    max-width: 380px;
    height: 5px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 2px;
}

.tuner-hold-progress {
    height: 100%;
    width: 0%;
    background: var(--green);
    border-radius: 3px;
    transition: width 0.05s linear;
}

.tuner-status.is-holding {
    color: var(--green);
    font-weight: 800;
}

.btn-primary.btn-active {
    background: var(--coral) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 20px -6px rgba(204, 60, 48, 0.6) !important;
}

/* Karta zadania wokalnego */
.sing-task-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--surface);
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    margin: 10px auto 16px;
    max-width: 540px;
    box-shadow: var(--shadow-subtle);
    text-align: left;
}

.sing-task-badge {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--gold-soft);
    color: var(--gold);
    border: 1.5px solid var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1;
}

.sing-task-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sing-task-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sing-tag {
    font-size: 0.76rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    letter-spacing: 0.02em;
}

.sing-tag.tag-step {
    background: var(--gold-soft);
    color: var(--gold);
    border: 1px solid var(--gold);
}

.sing-tag.tag-attempt {
    background: var(--plum-soft);
    color: var(--plum);
    border: 1px solid var(--plum);
}

.sing-tag.tag-direction-up {
    background: var(--teal-soft);
    color: var(--teal);
}

.sing-tag.tag-direction-down {
    background: var(--indigo-soft);
    color: var(--indigo);
}

.sing-tag.tag-root {
    background: var(--surface-subtle);
    color: var(--ink);
    border: 1px solid var(--border);
}

.sing-task-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.25;
}

.sing-task-title strong {
    color: var(--gold);
    font-weight: 800;
}

/* Podświetlenie aktywnej nuty docelowej w Verovio SVG */
.notation-container g.note.note-current-target * {
    fill: var(--gold) !important;
    stroke: var(--gold) !important;
}

.notation-container g.note.note-feedback-correct * {
    fill: var(--green) !important;
    stroke: var(--green) !important;
}

.notation-container g.note.note-feedback-warn * {
    fill: var(--gold) !important;
    stroke: var(--gold) !important;
    opacity: 0.95;
}

.notation-container g.note.note-feedback-wrong * {
    fill: var(--coral) !important;
    stroke: var(--coral) !important;
}

.feedback-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 500;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.dot-correct {
    background: var(--green);
}

.legend-dot.dot-warn {
    background: var(--gold);
}

.legend-dot.dot-wrong {
    background: var(--coral);
}

@media (max-width: 600px) {
    .widget {
        padding: 20px 14px 18px;
        border-radius: 16px;
    }
    .widget-header h1 {
        font-size: 1.35rem;
        margin: 0 0 4px;
    }
    .widget-header p {
        font-size: 0.85rem;
    }
    .controls-row {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 10px;
    }
    .field {
        flex: 1 1 120px;
        min-width: 110px;
        max-width: none;
    }
    .field label {
        font-size: 0.68rem;
        margin-bottom: 4px;
    }
    .field select {
    }
    .player-controls {
        margin: 12px 0 14px;
        gap: 8px;
    }
    .btn-primary, .btn-dark {
        padding: 11px 22px;
        font-size: 0.88rem;
    }
    .btn-ghost {
        padding: 9px 16px;
        font-size: 0.82rem;
    }
    .staff {
        margin: 12px auto;
    }
    .answer-group {
        margin: 12px 0 16px;
    }
    .notation-wrap {
        margin-bottom: 12px;
    }
    .notation-container {
        padding: 10px 6px;
        border-radius: 12px;
    }
    .feedback-msg {
        min-height: 22px;
        font-size: 0.92rem;
        margin-bottom: 10px;
    }
    .feedback-area {
        min-height: 38px;
        margin: 12px 0 0;
    }
    .intervals-grid {
        gap: 6px;
    }
    .interval-choice {
        padding: 10px 4px 8px;
    }
    .interval-choice strong {
        font-size: 0.95rem;
    }
    .puzzle-grid {
        gap: 6px;
        margin-bottom: 12px;
    }
    .note-edit-group {
        gap: 8px;
        margin-bottom: 12px;
    }
    .piano-keyboard-wrap {
        margin: 10px 0 14px;
    }
    .sing-task-card {
        padding: 10px 14px;
        gap: 12px;
    }
    .sing-task-badge {
        width: 44px;
        height: 44px;
        font-size: 1.35rem;
        border-radius: 10px;
    }
    .sing-task-title {
        font-size: 1.02rem;
    }
    .tuner-card {
        padding: 12px 14px;
        margin: 10px 0 14px;
    }
    .tuner-note {
        font-size: 1.5rem;
    }
}
