:root {
    color-scheme: dark;
    --bg: #08060d;
    --panel: rgba(18, 13, 23, 0.95);
    --panel-soft: rgba(255, 255, 255, 0.035);
    --text: #fff7f9;
    --text-soft: #eccbd6;
    --muted: #9f8995;
    --border: rgba(255, 132, 181, 0.16);
    --border-strong: rgba(255, 112, 170, 0.36);
    --pink: #ff557f;
    --pink-hot: #ff3672;
    --coral: #ff625a;
    --orange: #ff9c4a;
    --yellow: #e8db45;
    --mint: #54d39b;
    --violet: #a465ed;
    --fuchsia: #f34eb6;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background-color: #0b060f;
}

body {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    background-color: #0b060f;
    font-family: inherit;
    position: relative;
}

.confetti-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999;
}

.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: #0b060f;
    background-image: url("./img/bg.webp");
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: cover;
    z-index: 0;
    pointer-events: none;
    transform: translateZ(0);
}

button {
    font: inherit;
}

button:focus-visible {
    outline: 3px solid rgba(255, 96, 145, 0.48);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

.ambient {
    display: none;
}

.ambient--coral {
    top: 5rem;
    left: -15rem;
    background: var(--coral);
}

.ambient--blue {
    top: -18rem;
    left: calc(50% - 14rem);
    background: #4c72d6;
}

.ambient--pink {
    right: -16rem;
    bottom: 2rem;
    background: var(--fuchsia);
}

.app-shell {
    position: relative;
    z-index: 1;
    width: min(1080px, calc(100% - 36px));
    margin: 0 auto;
    padding: 6px 14px 14px;
    isolation: isolate;
}

.hero {
    position: relative;
    min-height: 114px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4px 0 2px;
}

.hero > div {
    max-width: 100%;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.hero h1 {
    margin: 0;
    color: #fff5ed;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3.2rem, 5.2vw, 4.3rem);
    font-weight: 500;
    line-height: 0.92;
    letter-spacing: 0.025em;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.95), 0 0 40px rgba(255, 60, 120, 0.45);
}

.hero h1 span {
    color: #f1b9c5;
    font-size: 0.72em;
}

.hero__subtitle {
    margin: 8px 0 0;
    color: #ffd8e2;
    font-size: 1.02rem;
    font-weight: 520;
    letter-spacing: 0.15em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}

.hero__mini-heart {
    display: block;
    width: 164px;
    margin: 8px auto 0;
    color: #ff527d;
    font-size: 0.68rem;
    line-height: 1;
}

.hero__mini-heart::before,
.hero__mini-heart::after {
    content: "";
    display: inline-block;
    width: 70px;
    height: 1px;
    vertical-align: middle;
    background: linear-gradient(90deg, transparent, rgba(255, 98, 142, 0.7), transparent);
}

.hero__mini-heart::before {
    margin-right: 9px;
}

.hero__mini-heart::after {
    margin-left: 9px;
}

.hero__hint {
    margin: 10px auto 4px;
    max-width: 580px;
    width: 100%;
    box-sizing: border-box;
    font-size: 0.90rem;
    line-height: 1.45;
    color: rgba(255, 218, 232, 0.82);
    font-weight: 420;
    letter-spacing: 0.015em;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
}

.hero__heart {
    position: absolute;
    top: 44px;
    color: #ff668e;
    font-family: Georgia, serif;
    font-size: 3.1rem;
    line-height: 1;
    text-shadow: 0 0 22px rgba(255, 59, 120, 0.45);
}

.hero__heart--left {
    left: 22%;
    transform: rotate(-9deg);
}

.hero__heart--right {
    right: 22%;
    transform: rotate(9deg);
}

.control-panel {
    min-width: 0;
    max-width: 100%;
    min-height: 74px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1px 286px;
    gap: 18px;
    align-items: center;
    margin: 0 0 12px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 132, 181, 0.22);
    border-radius: 17px;
    background: rgba(30, 18, 32, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    box-sizing: border-box;
}

.music-picker {
    min-width: 0;
    max-width: 100%;
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 10px 8px 15px;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), transparent);
    box-sizing: border-box;
}

.music-picker__icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(234, 181, 205, 0.15);
    border-radius: 12px;
    color: #e6b4c9;
    background: rgba(255, 255, 255, 0.025);
    font-family: Georgia, serif;
    font-size: 1.35rem;
}

.music-picker__content {
    min-width: 0;
    max-width: 100%;
    flex: 1;
    overflow: hidden;
}

.music-picker__heading {
    min-width: 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.music-picker__heading strong {
    color: #f4dbe4;
    font-size: 0.76rem;
    font-weight: 640;
}

.music-picker__heading span {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.music-track-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
}

.music-track {
    min-width: 0;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 172, 203, 0.13);
    border-radius: 8px;
    padding: 0 7px;
    overflow: hidden;
    color: #bda2ae;
    background: rgba(255, 255, 255, 0.026);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 640;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: border-color 100ms ease, background 100ms ease, color 100ms ease, transform 90ms ease;
}

.music-track::before {
    content: "▶";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 4px;
    color: #a77f90;
    font-size: 0.52rem;
    line-height: 1;
    position: relative;
    top: -0.5px;
}

.music-track:hover:not(:disabled) {
    border-color: rgba(255, 122, 168, 0.34);
    color: #f7dce7;
    background: rgba(255, 255, 255, 0.05);
}

.music-track:active:not(:disabled) {
    transform: scale(0.975);
}

.music-track.is-selected {
    border-color: rgba(255, 104, 151, 0.48);
    color: #ffeaf2;
    background: rgba(224, 56, 105, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.music-track.is-previewing::before {
    content: "■";
    color: #ff6f96;
}

.music-track:disabled {
    opacity: 0.43;
    cursor: not-allowed;
}

.control-panel__rule {
    width: 1px;
    height: 52px;
    background: linear-gradient(transparent, rgba(255, 164, 198, 0.18), transparent);
}

.recorder {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 13px;
    align-items: center;
}

.record-meta {
    display: none;
    grid-template-columns: 8px 1fr;
    align-items: center;
    gap: 3px 8px;
    color: var(--muted);
    font-size: 0.75rem;
}

.recorder:has(.record-meta.is-recording) {
    grid-template-columns: minmax(92px, 1fr) 164px;
}

.record-meta.is-recording {
    display: grid;
}

.record-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #756b73;
}

.record-timer {
    grid-column: 2;
    color: #e6cbd6;
    font-size: 0.95rem;
    font-weight: 660;
    font-variant-numeric: tabular-nums;
}

.record-visualizer {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
    grid-column: 2;
    margin-top: 3px;
}

.viz-bar {
    width: 3.5px;
    height: 3px;
    min-height: 3px;
    border-radius: 2px;
    background: #ff527d;
    box-shadow: 0 0 6px rgba(255, 82, 125, 0.65);
    transition: height 55ms ease, opacity 55ms ease;
    opacity: 0.35;
}

.record-meta.is-recording .record-indicator {
    background: #ff3d65;
    box-shadow: 0 0 0 5px rgba(255, 61, 101, 0.1), 0 0 14px rgba(255, 61, 101, 0.62);
    animation: pulse 1.25s ease-in-out infinite;
}

.record-meta.is-recording .record-timer,
.record-meta.is-recording #recordStatusText {
    color: #ffd5de;
}

@keyframes pulse {
    50% { opacity: 0.48; transform: scale(0.8); }
}

.record-button {
    min-height: 62px;
    border: 1px solid rgba(255, 118, 155, 0.58);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: white;
    background: linear-gradient(135deg, #f94e73, #bd2757);
    box-shadow: 0 9px 26px rgba(226, 45, 96, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: 760;
    transition: transform 90ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.record-button:hover {
    filter: brightness(1.08);
    box-shadow: 0 12px 32px rgba(226, 45, 96, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.27);
}

.record-button:active {
    transform: translateY(1px) scale(0.975);
}

.record-button.is-recording {
    border-color: rgba(241, 205, 216, 0.22);
    color: #f8e8ed;
    background: linear-gradient(135deg, #49323d, #2f222a);
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.record-button__icon {
    color: #fff2f5;
    font-size: 0.86rem;
}

.soundboard {
    padding: 0;
}

.soundboard__heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px 10px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 720;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.soundboard__heading h2 {
    margin: 0;
    color: #f7dce5;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    transition: color 200ms ease, text-shadow 200ms ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 68%;
}

.soundboard__heading h2.is-active-phrase {
    color: #ffe6f0;
    text-shadow: 0 0 14px rgba(255, 120, 170, 0.7), 0 2px 8px rgba(0, 0, 0, 0.85);
}

.explored-counter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 11px;
    border-radius: 999px;
    border: 1px solid rgba(255, 192, 218, 0.24);
    background: rgba(45, 18, 36, 0.60);
    color: #ffd8e6;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: border-color 200ms ease, background 200ms ease, color 200ms ease, box-shadow 200ms ease;
}

.explored-counter.is-complete {
    border-color: rgba(255, 215, 100, 0.65);
    background: rgba(70, 42, 10, 0.75);
    color: #ffe699;
    box-shadow: 0 0 16px rgba(255, 215, 100, 0.4);
}

.pad-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 9px;
}

.pad {
    --pad-color: var(--coral);
    --pad-rgb: 255, 98, 90;
    position: relative;
    min-width: 0;
    min-height: 82px;
    overflow: hidden;
    border: 1px solid rgba(var(--pad-rgb), 0.76);
    border-radius: 13px;
    padding: 10px 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(37, 16, 30, 0.92);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.33), transparent 44%),
        linear-gradient(145deg, rgba(var(--pad-rgb), 1), rgba(var(--pad-rgb), 0.84)),
        #171217;
    box-shadow:
        0 5px 0 rgba(var(--pad-rgb), 0.10),
        0 7px 20px rgba(var(--pad-rgb), 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.46),
        inset 0 -10px 20px rgba(0, 0, 0, 0.14);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    text-align: center;
    transition: transform 75ms ease, filter 90ms ease, box-shadow 90ms ease;
}

/* Световая волна воспроизведения слева направо */
.pad::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.14) 0%,
        rgba(255, 255, 255, 0.36) 70%,
        rgba(255, 255, 255, 0.74) 94%,
        rgba(255, 255, 255, 0.92) 100%
    );
    box-shadow: 4px 0 18px rgba(255, 255, 255, 0.85);
    transform: translateX(-100%);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
}

.pad.is-playing::before {
    opacity: 1;
    animation: padSweep var(--play-duration, 0.35s) linear forwards;
}

@keyframes padSweep {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(0%);
    }
}

.pad::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 24% 12%, rgba(255, 255, 255, 0.22), transparent 42%);
    pointer-events: none;
    z-index: 1;
}

.pad:hover {
    filter: brightness(1.12) saturate(1.05);
    transform: translateY(-1px);
}

.pad:active,
.pad.is-active {
    z-index: 1;
    transform: translateY(3px) scale(0.985);
    filter: brightness(1.30) saturate(1.12);
    box-shadow:
        0 1px 0 rgba(var(--pad-rgb), 0.14),
        0 0 22px rgba(var(--pad-rgb), 0.72),
        inset 0 3px 10px rgba(255, 255, 255, 0.16),
        inset 0 -5px 13px rgba(0, 0, 0, 0.08);
}

.pad.is-hit {
    animation: padHit 165ms ease-out;
}

@keyframes padHit {
    0% { filter: brightness(1.38) saturate(1.18); }
    100% { filter: brightness(1) saturate(1); }
}

.pad__star {
    position: absolute;
    top: 5px;
    right: 8px;
    color: #ffd978;
    font-size: 0.74rem;
    line-height: 1;
    text-shadow: 0 0 8px rgba(255, 217, 120, 0.95), 0 0 2px rgba(0, 0, 0, 0.85);
    opacity: 0;
    transform: scale(0.4) rotate(-15deg);
    transition: opacity 280ms ease, transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    z-index: 3;
}

.pad.is-explored .pad__star {
    opacity: 0.95;
    transform: scale(1) rotate(0deg);
}

.pad__label {
    position: relative;
    z-index: 2;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0 2px;
    color: #24111f;
    font-size: clamp(0.76rem, 0.95vw, 0.92rem);
    font-weight: 700;
    line-height: 1.18;
    text-align: center;
    text-wrap: balance;
    word-break: normal;
    overflow-wrap: break-word;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
}

.pad[data-column="0"] { --pad-color: var(--coral); --pad-rgb: 255, 98, 90; }
.pad[data-column="1"] { --pad-color: var(--orange); --pad-rgb: 255, 156, 74; }
.pad[data-column="2"] { --pad-color: var(--yellow); --pad-rgb: 232, 219, 69; color: #28210d; }
.pad[data-column="3"] { --pad-color: var(--mint); --pad-rgb: 84, 211, 155; color: #082d24; }
.pad[data-column="4"] { --pad-color: var(--violet); --pad-rgb: 164, 101, 237; }
.pad[data-column="5"] { --pad-color: var(--fuchsia); --pad-rgb: 243, 78, 182; }

.result-panel {
    margin: 0 0 15px;
    padding: 24px 26px 22px;
    border: 1px solid var(--border-strong);
    border-radius: 18px;
    text-align: center;
    background: linear-gradient(145deg, rgba(49, 26, 40, 0.94), rgba(25, 17, 28, 0.97));
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.035);
    animation: resultIn 240ms ease-out;
}

@keyframes resultIn {
    from { opacity: 0; transform: translateY(8px); }
}

.result-panel__eyebrow {
    margin: 0 0 4px;
    color: #ff7797;
    font-size: 0.66rem;
    font-weight: 820;
    letter-spacing: 0.2em;
}

.result-panel h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.95rem;
    font-weight: 500;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin: 17px 0;
}

.result-stat {
    display: grid;
    gap: 2px;
}

.result-stat strong {
    color: #fff2f5;
    font-size: 1.4rem;
    font-variant-numeric: tabular-nums;
}

.result-stat span {
    color: var(--muted);
    font-size: 0.72rem;
}

.result-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
}

.action-button {
    min-height: 41px;
    border: 1px solid rgba(255, 185, 210, 0.14);
    border-radius: 999px;
    padding: 0 18px;
    color: #ead8df;
    background: rgba(255, 255, 255, 0.045);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 650;
    transition: transform 90ms ease, background 100ms ease, border-color 100ms ease;
}

.action-button:hover:not(:disabled) {
    border-color: rgba(255, 133, 174, 0.38);
    background: rgba(255, 255, 255, 0.075);
}

.action-button:active:not(:disabled) {
    transform: scale(0.975);
}

.action-button--primary {
    border-color: rgba(255, 104, 149, 0.48);
    color: white;
    background: linear-gradient(135deg, #e84470, #ad2858);
    box-shadow: 0 8px 22px rgba(211, 47, 97, 0.2);
}

.action-button:disabled {
    opacity: 0.33;
    cursor: not-allowed;
}

.result-note {
    margin: 11px 0 0;
    color: #806d76;
    font-size: 0.68rem;
}

.error-message {
    margin: 14px 0 0;
    padding: 12px 14px;
    border: 1px solid rgba(255, 86, 112, 0.32);
    border-radius: 12px;
    color: #ffc9d1;
    background: rgba(130, 25, 47, 0.18);
    text-align: center;
    font-size: 0.82rem;
}

.footer {
    min-height: 44px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    padding: 10px 4px 2px;
    color: #ffd8e5;
    font-size: 0.76rem;
    letter-spacing: 0.055em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
}

.footer > span:last-child {
    text-align: right;
}

.footer i {
    color: #ff88ac;
    font-family: Georgia, serif;
    font-size: 0.95rem;
    font-style: normal;
}

.footer__center {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer__center b {
    display: block;
    width: 150px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 101, 151, 0.38));
}

.footer__center b:last-child {
    background: linear-gradient(90deg, rgba(255, 101, 151, 0.38), transparent);
}

.footer__center i {
    color: #ff5a83;
    font-size: 2rem;
    text-shadow: 0 0 14px rgba(242, 66, 112, 0.34);
}

@media (max-width: 1120px) {
    .app-shell {
        width: min(1000px, calc(100% - 24px));
    }

    .hero__heart--left { left: 16%; }
    .hero__heart--right { right: 16%; }
    .footer__center b { width: 100px; }
}

@media (max-width: 959px) {
    .app-shell {
        width: min(720px, calc(100% - 20px));
        padding: 4px 10px 14px;
    }

    /* Планшет: сетка 4x9 */
    .pad-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    .pad {
        min-height: 74px;
        padding: 8px 10px;
    }

    .pad__label {
        font-size: 0.92rem;
    }

    .hero h1 {
        font-size: clamp(2.8rem, 6.5vw, 3.8rem);
    }
}

@media (max-width: 768px) {
    .control-panel {
        position: relative;
        grid-template-columns: minmax(0, 1fr);
        min-width: 0;
        max-width: 100%;
        width: 100%;
        gap: 10px;
        margin: 6px 0 14px;
        padding: 8px 10px;
        background: rgba(26, 14, 28, 0.75);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
        box-sizing: border-box;
        overflow: hidden;
    }

    .control-panel__rule {
        display: none;
    }

    .music-picker {
        min-height: auto;
        min-width: 0;
        max-width: 100%;
        width: 100%;
        padding: 4px 6px;
        gap: 8px;
        box-sizing: border-box;
    }

    .music-picker__icon {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        font-size: 1.1rem;
    }

    .music-picker__content {
        min-width: 0;
        max-width: 100%;
        width: 100%;
        flex: 1;
        overflow: hidden;
    }

    .music-picker__heading {
        min-width: 0;
        max-width: 100%;
        gap: 8px;
        margin-bottom: 5px;
    }

    .music-picker__heading strong {
        flex-shrink: 0;
        font-size: 0.74rem;
    }

    .music-picker__heading span {
        min-width: 0;
        font-size: 0.70rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .music-track-list {
        min-width: 0;
        max-width: 100%;
        width: 100%;
        overflow-x: auto;
        display: flex;
        flex-wrap: nowrap;
        gap: 5px;
        padding-bottom: 3px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        box-sizing: border-box;
    }

    .music-track-list::-webkit-scrollbar {
        display: none;
    }

    .music-track {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 0 10px;
        min-height: 32px;
        font-size: 0.8rem;
    }

    .recorder {
        min-width: 0;
        max-width: 100%;
        width: 100%;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        box-sizing: border-box;
    }

    .recorder:has(.record-meta.is-recording) {
        grid-template-columns: minmax(0, 1fr);
    }

    .record-meta {
        justify-content: center;
        text-align: center;
    }

    .record-button {
        min-width: 0;
        max-width: 100%;
        width: 100%;
        min-height: 48px;
        font-size: 1.12rem;
        box-sizing: border-box;
    }

    .footer {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 8px;
    }

    .footer > span:last-child {
        text-align: center;
    }

    .footer__center {
        justify-content: center;
    }
}

@media (max-width: 639px) {
    .app-shell {
        width: calc(100% - 12px);
        padding: 4px 4px 14px;
        box-sizing: border-box;
    }

    .control-panel {
        padding: 6px 8px;
        margin: 4px 0 10px;
        border-radius: 14px;
    }

    .music-picker {
        padding: 2px 4px;
    }

    .music-picker__icon {
        width: 30px;
        height: 30px;
        flex: 0 0 30px;
        font-size: 0.95rem;
    }

    .record-button {
        min-height: 46px;
        font-size: 1.05rem;
    }

    /* Смартфоны: сетка 3x12 */
    .pad-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5.5px;
    }

    .pad {
        min-height: 68px;
        padding: 7px 4px;
        border-radius: 11px;
    }

    .pad__label {
        font-size: 0.80rem;
        line-height: 1.15;
        padding: 0 1px;
    }

    .hero {
        min-height: 90px;
    }

    .hero h1 {
        font-size: clamp(2.3rem, 9.5vw, 3.0rem);
    }

    .hero__subtitle {
        font-size: 0.90rem;
        letter-spacing: 0.08em;
    }

    .hero__hint {
        font-size: 0.80rem;
        line-height: 1.38;
        padding: 0 6px;
        margin-top: 6px;
    }

    .hero__heart--left,
    .hero__heart--right {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
