:root {
    color-scheme: dark;
    --black: #0a090b;
    --panel: #171419;
    --panel-soft: #211b20;
    --red: #e2382c;
    --orange: #ff8a27;
    --gold: #ffc44d;
    --text: #fff8f1;
    --muted: #b9aeb2;
    --line: rgba(255, 196, 77, .22);
}

/* Sound Match cards always use one square footprint; each face occupies it. */
.card-grid .sound-card,
.card-grid .sound-card.is-matched {
    display: block;
    min-height: 0;
    padding: 0;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    perspective: 1000px;
}

.sound-card-inner {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform .7s cubic-bezier(.2, .75, .2, 1);
}

.sound-card.is-flipped .sound-card-inner {
    transform: rotateY(180deg);
}

.sound-card-face {
    position: absolute;
    inset: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.sound-card-face--front {
    padding: clamp(4px, 2vw, 16px) clamp(4px, 1.5vw, 10px);
    background: linear-gradient(145deg, #242328, #17161b);
}

.sound-card-face--back {
    transform: rotateY(180deg);
    overflow: hidden;
    background: linear-gradient(145deg, #29252a, #121116);
}

.sound-card.is-selected {
    background: linear-gradient(145deg, #242328, #17161b);
}

.sound-card.is-selected .sound-card-face--front {
    box-shadow: inset 0 0 0 2px rgba(255, 196, 77, .7), inset 0 0 28px rgba(255, 138, 39, .24);
}

.sound-card .listen-badge {
    z-index: 4;
}

.sound-card-face--back .card-reveal {
    height: 100%;
}

.sound-card-face--back .card-art,
.sound-card-face--back .card-cover {
    height: auto;
    min-height: 0;
}

.sound-card-face--back .card-art {
    flex: 1 1 auto;
}

.card-listened-icon {
    color: var(--gold);
    font-size: clamp(1.35rem, 4vw, 2.2rem);
    filter: drop-shadow(0 0 12px rgba(255, 138, 39, .45));
}

.card-listened-label {
    margin-top: 8px;
    color: #fff8f1;
    font-size: clamp(.68rem, 1.6vw, .86rem);
    letter-spacing: .08em;
}

.card-listened-copy {
    margin-top: 4px;
    color: #d0c7cb;
    font-size: clamp(.5rem, 1.3vw, .65rem);
    font-weight: 800;
    letter-spacing: .04em;
}

@media (prefers-reduced-motion: reduce) {
    .sound-card-inner {
        transition-duration: .01ms;
    }
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 50% -10%, rgba(226, 56, 44, .24), transparent 42%),
        linear-gradient(160deg, #0a090b 0%, #151015 56%, #09080a 100%);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
audio {
    font: inherit;
}

.sound-match-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px 16px;
}

.sound-match-card {
    width: min(100%, 560px);
    padding: clamp(28px, 7vw, 54px) clamp(20px, 6vw, 48px);
    border: 1px solid var(--line);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(36, 28, 35, .98), rgba(14, 12, 16, .98));
    box-shadow: 0 28px 90px rgba(0, 0, 0, .46), inset 0 1px 0 rgba(255, 255, 255, .05);
    text-align: center;
}

.brand-mark {
    display: grid;
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    place-items: center;
    border: 1px solid rgba(255, 138, 39, .45);
    border-radius: 24px;
    background: radial-gradient(circle, rgba(255, 138, 39, .28), rgba(226, 56, 44, .08) 68%);
    box-shadow: 0 0 34px rgba(226, 56, 44, .18);
    font-size: 34px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--gold);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .22em;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 9vw, 3.5rem);
    line-height: .98;
    letter-spacing: .04em;
}

.tagline {
    margin: 16px 0 0;
    color: var(--orange);
    font-size: clamp(1rem, 4vw, 1.25rem);
    font-weight: 800;
}

.intro {
    max-width: 410px;
    margin: 16px auto 0;
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.6;
}

.clip-panel {
    min-height: 146px;
    margin: 28px 0 18px;
    padding: 22px 16px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
}

.clip-status {
    min-height: 1.25em;
    color: var(--gold);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.clip-title {
    overflow: hidden;
    margin-top: 13px;
    color: var(--text);
    font-size: clamp(1.15rem, 5vw, 1.45rem);
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clip-artist,
.clip-genre {
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clip-artist {
    margin-top: 5px;
    font-size: .95rem;
}

.clip-genre {
    margin-top: 9px;
    color: var(--orange);
    font-size: .78rem;
    font-weight: 700;
}

.primary-button {
    width: 100%;
    min-height: 56px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(100deg, var(--red), var(--orange));
    color: #fff;
    cursor: pointer;
    font-size: .9rem;
    font-weight: 900;
    letter-spacing: .08em;
    box-shadow: 0 12px 30px rgba(226, 56, 44, .25);
    transition: transform .18s ease, filter .18s ease, opacity .18s ease;
}

.primary-button:hover:not(:disabled),
.primary-button:focus-visible:not(:disabled) {
    filter: brightness(1.08);
    transform: translateY(-2px);
}

.primary-button:focus-visible {
    outline: 3px solid rgba(255, 196, 77, .48);
    outline-offset: 3px;
}

.primary-button:disabled {
    cursor: not-allowed;
    opacity: .52;
}

.tap-note {
    margin: 14px 0 0;
    color: #897f84;
    font-size: .76rem;
    line-height: 1.45;
}

audio {
    display: none;
}

.sound-match-confetti {
    position: fixed;
    z-index: 2000;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.sound-match-confetti-piece {
    position: absolute;
    top: -18px;
    width: 8px;
    height: 14px;
    border-radius: 2px;
    background: var(--confetti-color);
    opacity: 0;
    animation: sound-match-confetti-fall var(--confetti-duration) ease-out var(--confetti-delay) forwards;
}

@keyframes sound-match-confetti-fall {
    0% {
        opacity: 1;
        transform: translate3d(0, -18px, 0) rotate(var(--confetti-rotation));
    }

    100% {
        opacity: 0;
        transform: translate3d(var(--confetti-drift), 105vh, 0) rotate(720deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sound-match-confetti-piece {
        animation-duration: .01ms;
    }
}

@media (max-width: 380px) {
    .sound-match-shell {
        padding: 12px;
    }

    .sound-match-card {
        border-radius: 22px;
    }
}

.sound-match-page {
    min-width: 0;
    background:
        radial-gradient(circle at 58% -8%, rgba(226, 56, 44, .2), transparent 34%),
        linear-gradient(160deg, #0a090b 0%, #151015 56%, #09080a 100%);
}

.sound-match-main {
    display: grid;
    min-height: 100vh;
    margin-left: 260px;
    padding: 34px 24px;
    place-items: center;
}

.game-card {
    width: min(100%, 760px);
    padding: clamp(22px, 4vw, 38px);
    text-align: left;
}

.game-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.game-heading h1 {
    font-size: clamp(1.35rem, 3.2vw, 1.9rem);
    letter-spacing: .02em;
    white-space: nowrap;
}

.game-heading h1 span {
    color: var(--orange);
}

.sound-match-ad {
    display: grid;
    flex: 0 1 300px;
    min-height: 100px;
    margin-left: auto;
    place-items: center;
    text-align: center;
}

.sound-match-ad[hidden] {
    display: none;
}

.sound-match-ad-label {
    margin-bottom: 5px;
    color: #81777c;
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.sound-match-ad ins.adsbygoogle {
    display: block;
    width: 300px;
    max-width: 100%;
    height: 100px;
}

.game-level-row {
    display: flex;
    min-height: 42px;
    margin-top: 12px;
    align-items: center;
}

.level-badge {
    flex: 0 0 auto;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    color: var(--text);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .04em;
}

.game-intro {
    max-width: 530px;
    margin: 34px auto 0;
    text-align: center;
}

.resume-choice {
    max-width: 530px;
    margin: 34px auto 0;
    text-align: center;
}

.resume-actions {
    display: grid;
    max-width: 420px;
    margin: 20px auto 0;
    gap: 10px;
}

.genre-picker {
    display: grid;
    max-width: 420px;
    margin: 28px auto 0;
    gap: 9px;
    text-align: left;
}

.genre-picker label {
    color: var(--gold);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.genre-picker select {
    width: 100%;
    min-height: 50px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 13px;
    outline: 0;
    background: #211c21;
    color: var(--text);
}

.genre-picker select:focus-visible {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(255, 196, 77, .16);
}

.form-note,
.leaderboard-note {
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.45;
}

.form-note {
    margin: 0 0 8px;
}

.leaderboard-note {
    margin: 22px auto 0;
    text-align: center;
}

.error-text,
.game-error {
    color: #ff9d91;
}

.game-stage {
    margin-top: 30px;
}

.stats-flip {
    min-height: 92px;
    perspective: 1200px;
    transition: min-height .3s ease;
}

.stats-flip.is-flipped {
    min-height: 386px;
}

.stats-flip-inner {
    position: relative;
    width: 100%;
    min-height: inherit;
    transform-style: preserve-3d;
    transition: transform .55s ease;
}

.stats-flip.is-flipped .stats-flip-inner {
    transform: rotateY(180deg);
}

.stats-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.stats-face--back {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 13px;
    border: 1px solid rgba(255, 196, 77, .34);
    border-radius: 16px;
    background: linear-gradient(145deg, #2b2021, #17151a);
    transform: rotateY(180deg);
}

.top-streaks-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 0 3px 7px;
}

.top-streaks-heading strong {
    color: var(--gold);
    font-size: .76rem;
    letter-spacing: .12em;
}

.top-streaks-heading span,
.top-streaks-empty {
    margin: 0;
    color: var(--muted);
    font-size: .66rem;
}

.top-streaks-list {
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-color: rgba(255, 196, 77, .6) rgba(255, 255, 255, .06);
    scrollbar-width: thin;
}

.top-streaks-list::-webkit-scrollbar {
    width: 5px;
}

.top-streaks-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 196, 77, .6);
}

.top-streak-row {
    display: grid;
    position: relative;
    grid-template-columns: 32px var(--rank-avatar-size, 23px) minmax(0, 1fr) auto;
    align-items: center;
    min-height: calc(var(--rank-avatar-size, 23px) + 4px);
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.top-streak-rank {
    color: var(--gold);
    font-size: var(--rank-number-size, .64rem);
    font-weight: 900;
    text-align: center;
}

.top-streak-avatar {
    width: var(--rank-avatar-size, 23px);
    height: var(--rank-avatar-size, 23px);
    border: 1px solid rgba(255, 196, 77, .38);
    border-radius: 50%;
    object-fit: cover;
}

.top-streak-name {
    overflow: hidden;
    color: var(--text);
    font-size: .7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-streak-level {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: var(--muted);
    font-size: .58rem;
    font-weight: 800;
    white-space: nowrap;
}

.top-streak-score {
    color: var(--text);
    font-size: .7rem;
    font-weight: 900;
}

.top-streak-row.is-current-player {
    margin-top: 8px;
    border-color: rgba(255, 196, 77, .45);
    background: rgba(255, 196, 77, .08);
}

.top-streaks-button {
    width: 100%;
    min-height: 28px;
    margin-top: 8px;
    padding: 5px 12px;
    border: 1px solid rgba(255, 196, 77, .4);
    border-radius: 999px;
    background: rgba(255, 196, 77, .08);
    color: var(--gold);
    cursor: pointer;
    font-size: .64rem;
    font-weight: 900;
    letter-spacing: .13em;
}

.top-streaks-button:hover,
.top-streaks-button:focus-visible {
    border-color: var(--gold);
    background: rgba(255, 196, 77, .16);
}

.top-streaks-button:focus-visible {
    outline: 3px solid rgba(255, 196, 77, .25);
    outline-offset: 3px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.stat-box {
    min-height: 72px;
    padding: 12px 8px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 15px;
    background: rgba(255, 255, 255, .05);
    text-align: center;
}

.stat-box strong {
    display: block;
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1.3;
}

.stat-box:nth-child(2) strong {
    color: #ff8a27;
    font-size: 1.28rem;
    letter-spacing: .13em;
}

.stat-box:nth-child(2) .lives-value--safe {
    color: #ff8a27;
}

.stat-box:nth-child(2) .lives-value--warning {
    color: #ffc44d;
}

.stat-box:nth-child(2) .lives-value--danger {
    color: #ff4a3d;
}

.stat-box:nth-child(4) strong {
    color: var(--gold);
    font-size: 1.28rem;
}

.stat-box > span {
    display: block;
    margin-top: 4px;
    color: #a79ca1;
    font-size: .64rem;
    font-weight: 900;
    letter-spacing: .08em;
}

.life-overflow {
    display: inline !important;
    margin-left: 4px;
    color: var(--gold) !important;
    font-size: .72rem !important;
    letter-spacing: 0 !important;
}

.board-heading {
    margin: 24px 0 0;
    color: var(--text);
    font-size: clamp(1.2rem, 4vw, 1.55rem);
    text-align: center;
}

.board-heading.is-find-lead {
    color: var(--gold);
    font-size: clamp(.65rem, 2.6vw, 1.25rem);
    font-weight: 900;
    line-height: 1.18;
    letter-spacing: -.02em;
    white-space: nowrap;
}

.board-subheading {
    margin: 7px 0 17px;
    color: var(--orange);
    font-size: .78rem;
    font-weight: 800;
    text-align: center;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(var(--sound-match-columns, 3), minmax(0, 1fr));
    gap: 10px;
}

.sound-card {
    position: relative;
    display: grid;
    min-height: 145px;
    padding: 16px 10px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    background: linear-gradient(145deg, #242328, #17161b);
    color: var(--text);
    cursor: pointer;
    transition: border-color .18s ease, transform .18s ease, background .18s ease, opacity .18s ease;
}

.sound-card:hover:not(:disabled),
.sound-card:focus-visible:not(:disabled) {
    border-color: rgba(255, 138, 39, .72);
    transform: translateY(-2px);
}

.sound-card:focus-visible {
    outline: 3px solid rgba(255, 196, 77, .35);
    outline-offset: 2px;
}

.sound-card:disabled {
    cursor: default;
}

.sound-card.is-matched {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
    min-height: 170px;
    padding: 0;
    border-color: rgba(255, 196, 77, .62);
    background: linear-gradient(145deg, rgba(119, 67, 34, .9), rgba(37, 24, 25, .96));
}

.sound-card.is-matched .listen-badge {
    z-index: 2;
}

.sound-card.is-selected {
    border-color: var(--gold);
    background: var(--orange);
    box-shadow: 0 0 0 2px rgba(255, 196, 77, .18), 0 0 24px rgba(255, 138, 39, .28);
}

.listen-badge {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    top: 9px;
    right: 9px;
    min-width: 48px;
    min-height: 30px;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 900;
    letter-spacing: .03em;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .24);
}

.listen-badge--2 {
    border: 1px solid rgba(255, 138, 39, .82);
    background: #d96524;
    color: #fff7ef;
}

.listen-badge--1 {
    border: 1px solid rgba(255, 218, 72, .9);
    background: #e5bb2d;
    color: #271a08;
}

.listen-badge--0 {
    border: 1px solid rgba(255, 93, 87, .9);
    background: #c9363b;
    color: #fff4f2;
}

.listen-badge--bonus {
    border: 1px solid rgba(255, 218, 72, .95);
    background: linear-gradient(135deg, #ffcf42, #f08b23);
    color: #241406;
}

.card-flame {
    width: 54px;
    height: 54px;
    object-fit: contain;
    filter: drop-shadow(0 0 16px rgba(255, 90, 31, .45));
}

.card-label {
    margin-top: 9px;
    color: #d0c7cb;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.card-reveal {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    margin-top: 0;
    text-align: center;
}

.card-banner strong,
.card-banner span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-cover {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    object-fit: cover;
}

.card-art {
    display: grid;
    flex: 1 1 auto;
    min-height: 112px;
    padding: 0;
    place-items: center;
    background: rgba(10, 9, 11, .42);
}

.card-banner {
    display: grid;
    min-height: 52px;
    padding: 8px 9px 9px;
    align-content: center;
    gap: 3px;
    background: #050505;
}

.card-banner strong {
    color: var(--text);
    font-size: .76rem;
}

.card-banner span {
    color: var(--muted);
    font-size: .64rem;
}

.board-status {
    min-height: 1.4em;
    margin: 15px 0 0;
    color: var(--orange);
    font-size: 1.35rem;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
}

.board-status.is-match-lead,
.board-status.is-miss-lead {
    font-size: clamp(1.15rem, 3.2vw, 1.6rem);
    font-weight: 900;
    line-height: 1.25;
    animation: sound-match-lead-blink .22s ease-in-out 0s 2;
}

.board-status.is-match-lead {
    color: var(--orange);
}

.board-status.is-miss-lead {
    color: var(--red);
}

@keyframes sound-match-lead-blink {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: .2;
    }
}

@media (prefers-reduced-motion: reduce) {
    .board-status.is-match-lead,
    .board-status.is-miss-lead {
        animation: none;
    }
}

.transition-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid rgba(255, 196, 77, .3);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 138, 39, .12), rgba(255, 255, 255, .04));
}

.genre-change-panel {
    display: grid;
    gap: 10px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid rgba(255, 196, 77, .3);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 138, 39, .12), rgba(255, 255, 255, .04));
}

.genre-change-panel label {
    color: var(--gold);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.genre-change-panel select {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 13px;
    outline: 0;
    background: #211c21;
    color: var(--text);
}

.genre-change-panel select:focus-visible {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(255, 196, 77, .16);
}

.game-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.transition-panel[hidden],
.genre-change-panel[hidden],
.game-actions[hidden] {
    display: none;
}

.restart-game-button {
    border-color: rgba(246, 71, 49, .58);
    background: rgba(246, 71, 49, .12);
    color: #ffd5c9;
}

.restart-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(7, 5, 8, .78);
}

.restart-modal[hidden] {
    display: none;
}

.restart-modal-card {
    width: min(100%, 430px);
    padding: 22px;
    border: 1px solid rgba(255, 196, 77, .38);
    border-radius: 18px;
    background: #1c171c;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}

.restart-modal-card strong {
    color: var(--gold);
    font-size: 1.08rem;
}

.restart-modal-card p {
    margin: 12px 0 0;
    color: var(--text);
    font-size: .86rem;
    line-height: 1.45;
}

.restart-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.restart-cancel-button {
    border-color: rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .08);
    color: var(--text);
}

.result-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 20px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 16px;
    background: rgba(255, 255, 255, .04);
}

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

.result-copy {
    display: grid;
    gap: 4px;
}

.result-copy strong {
    color: var(--text);
    font-size: .88rem;
}

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

.secondary-button {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 15px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(100deg, var(--red), var(--orange));
    color: #fff;
    cursor: pointer;
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .06em;
}

.game-error {
    margin: 18px 0 0;
    text-align: center;
}

@media (max-width: 800px) {
    .sound-match-main {
        margin-left: 0;
        padding: 84px 14px 24px;
    }
}

@media (max-width: 500px) {
    .stats-flip {
        min-height: 154px;
    }

    .stats-flip.is-flipped {
        min-height: 400px;
    }

    .top-streaks-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .game-heading {
        display: grid;
        gap: 12px;
    }

    .sound-match-ad {
        display: flex;
        flex: 0 0 100%;
        width: min(300px, 100%);
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        justify-self: center;
    }

    .sound-match-ad ins.adsbygoogle {
        width: 300px !important;
        max-width: 100% !important;
        height: 100px !important;
        margin: 0 auto !important;
    }

    .game-heading h1 {
        white-space: normal;
    }

    .sound-card {
        min-height: 128px;
    }

    .sound-card.is-matched {
        min-height: 154px;
    }

    .card-cover {
        height: 94px;
    }

    .card-art {
        min-height: 94px;
    }

    .result-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .transition-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .game-actions {
        justify-content: stretch;
        flex-direction: column;
    }

    .restart-modal-actions {
        flex-direction: column;
    }

    .secondary-button {
        width: 100%;
    }
}

@media (max-width: 500px) {
    .sound-match-main {
        padding: 62px 8px 12px;
    }

    .game-card {
        padding: 16px 12px;
        border-radius: 20px;
    }

    .eyebrow {
        margin-bottom: 6px;
        font-size: .56rem;
    }

    .game-heading h1 {
        font-size: 1.18rem;
    }

    .game-level-row {
        min-height: 30px;
        margin-top: 6px;
    }

    .level-badge {
        padding: 7px 10px;
        font-size: .56rem;
    }

    .game-stage {
        margin-top: 14px;
    }

    .stats-grid {
        gap: 6px;
    }

    .stat-box {
        min-height: 52px;
        padding: 7px 5px;
        border-radius: 10px;
    }

    .stat-box strong,
    .stat-box:nth-child(2) strong,
    .stat-box:nth-child(4) strong {
        font-size: .9rem;
    }

    .stat-box > span {
        margin-top: 2px;
        font-size: .48rem;
    }

    .board-heading {
        margin-top: 14px;
        font-size: .84rem;
        line-height: 1.25;
    }

    .board-subheading {
        margin: 4px 0 10px;
        font-size: .54rem;
    }

    .card-grid {
        gap: 6px;
    }

    .sound-card {
        min-height: 94px;
        padding: 9px 4px;
        border-radius: 11px;
    }

    .sound-card.is-matched {
        min-height: 119px;
    }

    .listen-badge {
        top: 5px;
        right: 5px;
        min-width: 34px;
        min-height: 21px;
        padding: 4px 5px;
        font-size: .55rem;
    }

    .card-flame {
        width: 38px;
        height: 38px;
    }

    .card-label {
        margin-top: 5px;
        font-size: .5rem;
        letter-spacing: .02em;
    }

    .card-cover,
    .card-art {
        min-height: 67px;
        height: 67px;
    }

    .card-banner {
        min-height: 40px;
        padding: 6px 5px;
    }

    .card-banner strong {
        font-size: .55rem;
    }

    .card-banner span {
        font-size: .5rem;
    }

    .board-status {
        margin-top: 9px;
        font-size: .85rem;
        letter-spacing: -.025em;
    }

    .game-actions {
        margin-top: 10px;
    }

    .primary-button {
        min-height: 40px;
        font-size: .62rem;
    }
}

@media (min-width: 801px) {
    .sound-match-main {
        padding: 18px;
    }

    .game-card {
        padding: 18px 26px;
    }

    .game-heading {
        gap: 12px;
    }

    .game-heading h1 {
        font-size: 1.7rem;
    }

    .game-level-row {
        min-height: 34px;
        margin-top: 8px;
    }

    .level-badge {
        padding: 8px 12px;
        font-size: .64rem;
    }

    .game-stage {
        margin-top: 18px;
    }

    .stats-grid {
        gap: 8px;
    }

    .stat-box {
        min-height: 58px;
        padding: 9px 6px;
        border-radius: 12px;
    }

    .stat-box strong {
        font-size: .95rem;
    }

    .stat-box:nth-child(2) strong,
    .stat-box:nth-child(4) strong {
        font-size: 1.08rem;
    }

    .stat-box > span {
        margin-top: 2px;
        font-size: .56rem;
    }

    .board-heading {
        margin-top: 16px;
        font-size: 1.2rem;
    }

    .board-subheading {
        margin: 4px 0 10px;
        font-size: .68rem;
    }

    .card-grid {
        gap: 8px;
    }

    .sound-card {
        min-height: 112px;
        padding: 11px 8px;
        border-radius: 13px;
    }

    .sound-card.is-matched {
        min-height: 140px;
    }

    .listen-badge {
        top: 7px;
        right: 7px;
        min-width: 42px;
        min-height: 25px;
        padding: 5px 7px;
        font-size: .67rem;
    }

    .card-flame {
        width: 44px;
        height: 44px;
    }

    .card-label {
        margin-top: 7px;
        font-size: .62rem;
    }

    .card-cover,
    .card-art {
        min-height: 92px;
        height: 92px;
    }

    .card-art {
        flex: 0 0 92px;
    }

    .card-banner {
        min-height: 48px;
        padding: 6px 7px;
    }

    .card-banner strong {
        font-size: .65rem;
    }

    .card-banner span {
        font-size: .56rem;
    }

    .board-status {
        margin-top: 10px;
        font-size: 1.44rem;
    }

    .transition-panel,
    .result-panel {
        margin-top: 12px;
        padding: 10px;
    }

    .game-actions {
        margin-top: 10px;
    }

    .secondary-button {
        min-height: 36px;
    }
}
