:root {
    --bg-main: #f4f2fb;
    --bg-soft: #ece9f8;
    --bg-card: #ffffff;
    --bg-card-soft: #f1eefb;
    --purple-1: #8f86c9;
    --purple-2: #aba4dd;
    --purple-3: #c6c1e5;
    --pink-soft: #dcd6f2;
    --text-main: #3f3a57;
    --text-muted: #6e678b;
    --text-light: #a29cbe;
    --ok: #58bf8b;
    --error: #d996cb;
    --shadow-soft: 0 10px 22px rgba(115, 108, 166, 0.16);
    --shadow-strong: 0 14px 28px rgba(105, 97, 156, 0.22);
    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --transition: 0.25s ease;
    --pet-strip-height: 104px;
    --aurora-default: radial-gradient(circle at 14% 22%, rgba(198, 193, 229, 0.64) 0%, rgba(198, 193, 229, 0) 53%),
        radial-gradient(circle at 86% 20%, rgba(177, 197, 233, 0.48) 0%, rgba(177, 197, 233, 0) 56%),
        radial-gradient(circle at 26% 84%, rgba(212, 204, 241, 0.56) 0%, rgba(212, 204, 241, 0) 55%),
        radial-gradient(circle at 84% 78%, rgba(169, 187, 226, 0.46) 0%, rgba(169, 187, 226, 0) 60%);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    color: var(--text-main);
    background: linear-gradient(160deg, #f2f0fb 0%, #ece9f8 48%, #f8f7fd 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    isolation: isolate;
}

.aurora-shell {
    position: fixed;
    inset: -12vh -14vw;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.aurora-layer {
    position: absolute;
    inset: 0;
    opacity: 0;
    background-image: var(--aurora-default);
    background-size: 142% 142%;
    background-position: 50% 50%;
    transition: opacity 1.4s ease;
    will-change: opacity;
}

.aurora-layer.is-visible {
    opacity: 1;
}

h1,
h2,
h3 {
    font-family: 'Quicksand', sans-serif;
    line-height: 1.2;
}

.floating-hearts {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.heart {
    position: absolute;
    font-size: 1.2rem;
    color: #b3abd8;
    opacity: 0.28;
    animation: floatHeart 20s linear infinite;
}

.heart:nth-child(1) {
    left: 8%;
    animation-delay: 0s;
}

.heart:nth-child(2) {
    left: 24%;
    animation-delay: 2s;
}

.heart:nth-child(3) {
    left: 41%;
    animation-delay: 4s;
}

.heart:nth-child(4) {
    left: 58%;
    animation-delay: 6s;
}

.heart:nth-child(5) {
    left: 76%;
    animation-delay: 8s;
}

.heart:nth-child(6) {
    left: 91%;
    animation-delay: 10s;
}

@keyframes floatHeart {
    0% {
        transform: translateY(120vh) rotate(0deg);
        opacity: 0;
    }

    15% {
        opacity: 0.35;
    }

    85% {
        opacity: 0.35;
    }

    100% {
        transform: translateY(-20vh) rotate(360deg);
        opacity: 0;
    }
}

.hero {
    position: relative;
    z-index: 2;
    padding: 18px 14px 8px;
}

.hero-content {
    max-width: 640px;
    margin: 0 auto;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(238, 234, 250, 0.94));
    border: 1px solid rgba(163, 154, 212, 0.34);
    border-radius: var(--radius-lg);
    box-shadow: 0 14px 30px rgba(114, 106, 168, 0.16);
    padding: 18px 16px 16px;
    backdrop-filter: blur(4px);
}

.hero-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #5f5695;
    background: #ebe7f8;
    border-radius: 999px;
    padding: 4px 10px;
    margin-bottom: 10px;
}

.hero-title {
    font-size: 1.35rem;
    margin-bottom: 6px;
}

#dynamicName {
    color: #7d74bd;
}

.hero-subtitle {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

/* ---- Hero running cat ---- */

.hero-cat-track {
    position: relative;
    width: 100%;
    height: 72px;
    overflow: hidden;
    margin-bottom: 6px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(236, 230, 249, 0.52), rgba(219, 230, 247, 0.34));
}

.hero-cat {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 64px;
    height: 64px;
    background-repeat: no-repeat;
    background-position: 0 0;
    background-size: 64px auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    will-change: transform;
    transform: translateX(var(--cat-x, 0px)) scaleX(var(--cat-dir, 1));
}

.hero-cat-stunt {
    position: fixed;
    left: 0;
    top: 0;
    bottom: auto;
    z-index: 62;
    pointer-events: none;
    will-change: transform, opacity;
    transform: translate3d(0, 0, 0) scaleX(1);
}

.hero-cat-bubble {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 63;
    pointer-events: none;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(191, 182, 224, 0.86);
    background: rgba(255, 255, 255, 0.97);
    color: #6b61a5;
    font-size: 0.72rem;
    font-weight: 700;
    box-shadow: 0 8px 16px rgba(114, 106, 168, 0.2);
    opacity: 0;
    transform: translate3d(-50%, -8px, 0) scale(0.9);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.hero-cat-bubble.show {
    opacity: 1;
    transform: translate3d(-50%, -14px, 0) scale(1);
}

/* walk — run.png, 6 frames */
.hero-cat--walk {
    background-image: url('run.png');
    animation: heroCatWalk 0.45s steps(6) infinite;
}

/* rush — rush.png, 26 frames, one-shot hunting sequence */
.hero-cat--rush {
    background-image: url('rush.png');
    animation: heroCatRush 1.3s steps(26) forwards;
}

@keyframes heroCatWalk {
    from {
        background-position-y: 0;
    }

    to {
        background-position-y: -384px;
    }
}

@keyframes heroCatRush {
    from {
        background-position-y: 0;
    }

    to {
        background-position-y: -1664px;
    }
}

.search-container {
    width: 100%;
}

.search-wrapper {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border-radius: 999px;
    border: 1px solid #d3ccef;
    box-shadow: 0 8px 18px rgba(112, 104, 162, 0.14);
    padding: 6px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.search-wrapper:focus-within {
    border-color: var(--purple-2);
    box-shadow: 0 10px 20px rgba(112, 104, 162, 0.19);
}

.search-icon {
    font-size: 1.06rem;
    color: #8f87c2;
    margin-left: 8px;
}

.search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 0.95rem;
    color: var(--text-main);
    padding: 8px 4px;
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-btn {
    border: 0;
    border-radius: 999px;
    background: linear-gradient(145deg, var(--purple-1), var(--purple-2));
    color: #fff;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    min-width: 90px;
    justify-content: center;
    flex-shrink: 0;
    white-space: nowrap;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
}

.search-btn::after {
    content: '';
    position: absolute;
    inset: 0 auto 0 -70%;
    width: 44%;
    background: linear-gradient(105deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0));
    transition: transform 0.45s ease;
    transform: skewX(-14deg);
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-strong);
}

.search-btn:hover::after {
    transform: translateX(220%) skewX(-14deg);
}

.search-btn:active {
    transform: translateY(0);
}

.pet-strip {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--pet-strip-height);
    z-index: 35;
    pointer-events: none;
    overflow: hidden;
}

.pet-strip::before {
    content: none;
}

.pet-strip::after {
    content: none;
}

.pet-sprite {
    position: absolute;
    left: 0;
    bottom: 14px;
    width: 64px;
    height: 64px;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    will-change: transform, background-position;
    transform: translate3d(-64px, 0, 0);
}

.main-content {
    position: relative;
    z-index: 2;
    width: 100%;
    margin: 0;
    padding: 0 14px 0;
    overflow: visible;
    pointer-events: auto;
}

body.search-active .main-content {
    padding-bottom: calc(34px + var(--pet-strip-height));
}

.section-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.02rem;
    margin-bottom: 12px;
    color: var(--text-main);
    letter-spacing: 0.01em;
}

.section-title i {
    color: #8f86c9;
}

.hidden {
    display: none !important;
}

.results-section {
    max-width: 640px;
    margin: 0 auto 14px;
    padding: 11px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(206, 198, 232, 0.72);
    box-shadow: 0 10px 24px rgba(109, 100, 162, 0.15);
}

.search-source-status {
    margin: -2px 0 10px;
    font-size: 0.76rem;
    color: #5f5695;
    background: rgba(229, 225, 245, 0.9);
    border: 1px solid #cec7e9;
    border-radius: 999px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.results-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-card {
    appearance: none;
    width: 100%;
    border: 1px solid #ddd7ef;
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(242, 238, 252, 0.92));
    box-shadow: 0 8px 18px rgba(110, 101, 159, 0.13);
    display: grid;
    grid-template-columns: 52px 1fr 36px;
    align-items: center;
    gap: 10px;
    padding: 8px;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.result-card:hover {
    transform: translateY(-1px);
    border-color: #c5bedf;
    box-shadow: 0 10px 20px rgba(110, 101, 159, 0.17);
}

.result-card.active {
    border-color: var(--purple-1);
    background: linear-gradient(145deg, #ffffff, #efebfa);
}

.result-card.playing {
    border-color: #7d74bd;
    box-shadow: 0 10px 22px rgba(110, 101, 159, 0.22);
}

.result-card.loading {
    pointer-events: none;
}

.result-thumbnail {
    width: 52px;
    height: 52px;
    border-radius: 11px;
    object-fit: cover;
    background: #ebe7f7;
}

.result-info {
    min-width: 0;
}

.result-title {
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-artist {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.result-play {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--purple-1), var(--purple-2));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.result-play-icon {
    line-height: 1;
}

.result-card.playing .result-play {
    background: linear-gradient(145deg, #7168ac, #9b94d1);
}

.player-section {
    max-width: 640px;
    margin: 0 auto 8px;
}

.player-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.video-container {
    position: relative;
}

.player-wrapper {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

.youtube-player {
    width: 1px;
    height: 1px;
}

.now-playing {
    background: linear-gradient(145deg, #ffffff, #f1eefb);
    border-radius: var(--radius-lg);
    border: 1px solid #ddd6ef;
    box-shadow: 0 14px 26px rgba(112, 104, 162, 0.17);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.now-playing-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.now-playing-icon {
    font-size: 1.8rem;
    color: #9f98d4;
}

.now-playing-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.now-playing-title {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 0.96rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.now-playing-artist {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.player-controls {
    display: grid;
    grid-template-columns: 44px 44px 44px 1fr;
    gap: 8px;
    align-items: center;
}

.control-btn {
    border: 0;
    border-radius: 50%;
    height: 44px;
    width: 44px;
    background: #e8e4f6;
    color: #5f5695;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.12rem;
    cursor: pointer;
    transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.control-btn.primary {
    background: linear-gradient(145deg, var(--purple-1), var(--purple-2));
    color: #fff;
}

.control-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(112, 104, 162, 0.22);
}

.control-btn:active {
    transform: scale(0.97);
}

.playback-meta {
    min-width: 0;
    background: var(--bg-card-soft);
    border-radius: 12px;
    border: 1px solid #d7d0eb;
    padding: 7px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.playback-state {
    font-size: 0.76rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playback-clock {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 2px;
}

.lyrics-container {
    background: linear-gradient(145deg, #ffffff, #f2effb);
    border-radius: var(--radius-lg);
    border: 1px solid #ddd6ef;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.lyrics-header {
    padding: 12px 14px;
    border-bottom: 1px solid #e3dcf2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.lyrics-header h3 {
    font-size: 0.96rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.lyrics-header i {
    color: #8f86c9;
}

.lyrics-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.lyrics-status.success {
    color: var(--ok);
}

.lyrics-status.error {
    color: var(--error);
}

.lyrics-content {
    height: 190px;
    max-height: 190px;
    overflow-y: auto;
    padding: 12px 14px 16px;
    overscroll-behavior: contain;
}

.lyrics-content.lyrics-synced {
    padding-top: 76px;
    padding-bottom: 76px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.lyrics-content.lyrics-synced::-webkit-scrollbar {
    display: none;
}

.lyrics-content::-webkit-scrollbar {
    width: 7px;
}

.lyrics-content::-webkit-scrollbar-track {
    background: #e8e3f5;
    border-radius: 20px;
}

.lyrics-content::-webkit-scrollbar-thumb {
    background: #b5afd6;
    border-radius: 20px;
}

.lyrics-placeholder {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-light);
    text-align: center;
}

.lyrics-placeholder.compact {
    min-height: 130px;
}

.lyrics-placeholder i {
    font-size: 2.2rem;
    color: #9f98d4;
}

.lyrics-line {
    padding: 9px 10px;
    margin: 2px 0;
    border-radius: 9px;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.4;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), transform var(--transition);
}

@media (hover: hover) and (pointer: fine) {
    .lyrics-line:hover {
        background: #ece8f8;
        color: var(--text-main);
    }
}

.lyrics-line.active {
    background: linear-gradient(145deg, #cfc9e9, #e2ddf3);
    color: #443f61;
    font-weight: 700;
    transform: translateX(3px);
}

.lyrics-line.instrumental {
    font-style: italic;
    color: var(--text-light);
}

.plain-lyrics {
    white-space: pre-wrap;
    line-height: 1.7;
    color: var(--text-main);
}

/* ============ MEMORIES SECTION ============ */

.memories-section {
    position: relative;
    z-index: 2;
    padding: 16px 14px 18px;
    border-top: 1px solid rgba(201, 192, 230, 0.48);
    background: linear-gradient(180deg, rgba(239, 235, 250, 0.28), rgba(239, 235, 250, 0));
}

.memories-inner {
    max-width: 640px;
    margin: 0 auto;
    max-height: 2000px;
    overflow: hidden;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.28s ease, transform 0.28s ease, max-height 0.34s ease;
}

body.search-active .memories-section {
    padding: 10px 14px 16px;
    min-height: 72px;
    background: linear-gradient(165deg, rgba(206, 198, 235, 0.32), rgba(175, 191, 231, 0.2));
}

body.search-active .memories-inner {
    opacity: 0;
    transform: translateY(8px);
    max-height: 0;
    pointer-events: none;
}

body.search-active .footer::before {
    content: '';
    display: block;
    height: 8px;
    margin: 0 auto 10px;
    width: min(640px, calc(100% - 8px));
}

.memories-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    color: #7d6bb5;
    background: linear-gradient(135deg, #ede8fa, #e3ddf7);
    border-radius: 999px;
    padding: 4px 12px;
    margin-bottom: 8px;
}

.memories-title {
    font-size: 1.18rem;
    margin-bottom: 12px;
    color: var(--text-main);
}

.memories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* --- Flip card --- */

.memory-card {
    perspective: 800px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.memory-card-inner {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3.45;
    transition: transform 0.6s cubic-bezier(.4, .2, .2, 1);
    transform-style: preserve-3d;
}

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

.memory-front,
.memory-back {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    overflow: hidden;
}

.memory-front {
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.92), rgba(237, 233, 250, 0.88));
    border: 1px solid rgba(180, 172, 220, 0.38);
    box-shadow: 0 8px 20px rgba(120, 112, 170, 0.14);
    gap: 4px;
    animation: memFloat 4.5s ease-in-out infinite;
}

.memory-card[data-index="1"] .memory-front {
    animation-delay: 0.5s;
}

.memory-card[data-index="2"] .memory-front {
    animation-delay: 1.0s;
}

.memory-card[data-index="3"] .memory-front {
    animation-delay: 1.5s;
}

.memory-card[data-index="4"] .memory-front {
    animation-delay: 2.0s;
}

.memory-card[data-index="5"] .memory-front {
    animation-delay: 2.5s;
}

.memory-back {
    background: linear-gradient(155deg, #d8d1f0, #c5bde6);
    border: 1px solid rgba(160, 150, 210, 0.45);
    box-shadow: 0 8px 22px rgba(110, 100, 165, 0.2);
    transform: rotateY(180deg);
    gap: 0;
}

.memory-emoji {
    font-size: 2rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(100, 90, 155, 0.2));
}

.memory-label {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-main);
    text-align: center;
    line-height: 1.2;
}

.memory-hint {
    font-size: 0.68rem;
    color: var(--text-light);
    opacity: 0.7;
    transition: opacity 0.3s;
}

.memory-card:hover .memory-hint {
    opacity: 1;
}

.memory-msg {
    font-family: 'Nunito', sans-serif;
    font-size: 0.76rem;
    font-weight: 600;
    color: #3e3862;
    text-align: center;
    line-height: 1.32;
    padding: 2px;
}

/* sparkle shimmer on back */
.memory-sparkle {
    position: absolute;
    inset: 0;
    background: linear-gradient(125deg,
            rgba(255, 255, 255, 0) 30%,
            rgba(255, 255, 255, 0.45) 50%,
            rgba(255, 255, 255, 0) 70%);
    background-size: 250% 250%;
    animation: memSparkle 2.8s ease-in-out infinite;
    pointer-events: none;
    border-radius: 16px;
}

@keyframes memFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

@keyframes memSparkle {
    0% {
        background-position: 200% 200%;
    }

    100% {
        background-position: -200% -200%;
    }
}

/* reveal animation on scroll */
.memory-card {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.memory-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.memory-card[data-index="1"].visible {
    transition-delay: 0.07s;
}

.memory-card[data-index="2"].visible {
    transition-delay: 0.14s;
}

.memory-card[data-index="3"].visible {
    transition-delay: 0.21s;
}

.memory-card[data-index="4"].visible {
    transition-delay: 0.28s;
}

.memory-card[data-index="5"].visible {
    transition-delay: 0.35s;
}

.footer {
    position: relative;
    z-index: 2;
    padding: 10px 14px calc(20px + var(--pet-strip-height));
    text-align: center;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.loading-skeleton {
    background: linear-gradient(90deg, #efebf8 25%, #fff 50%, #efebf8 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.spinning {
    animation: spin 2.5s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@media (min-width: 640px) {
    .hero {
        padding-top: 24px;
    }

    .hero-content {
        padding: 20px 20px 18px;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .main-content {
        padding-left: 18px;
        padding-right: 18px;
        padding-bottom: 0;
    }

    body.search-active .main-content {
        padding-bottom: calc(36px + var(--pet-strip-height));
    }

    .results-container {
        gap: 10px;
    }

    .lyrics-content {
        height: 220px;
        max-height: 220px;
    }

    .lyrics-content.lyrics-synced {
        padding-top: 90px;
        padding-bottom: 90px;
    }

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

    .memory-card-inner {
        aspect-ratio: 3 / 2.7;
    }

    .memory-emoji {
        font-size: 1.85rem;
    }
}

@media (max-width: 420px) {
    :root {
        --pet-strip-height: 96px;
    }

    .search-btn {
        min-width: 76px;
        padding: 10px 10px;
        font-size: 0.86rem;
    }

    .search-btn i {
        font-size: 0.95rem;
    }

    .memory-card-inner {
        aspect-ratio: 4 / 3.3;
    }

    .memory-msg {
        font-size: 0.72rem;
        line-height: 1.28;
    }

    .heart:nth-child(n+4) {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .heart {
        display: none;
    }

    .pet-sprite {
        transition: none;
    }
}
