/* 
 * FILE: /skin/fun/css/component.kalimba.css
 * VERSION: V26
 * DESC: Footer 列表去点终极修复版 (Fixed: Force remove list-style bullets with !important)
 * 
 * MODIFICATION HISTORY:
 * -----------------------------------------------------------------------------
 * [2025-11-23 15:10:00] V26: Added !important to list-style in footer to override Pico.css defaults.
 * [2025-11-23 15:00:00] V25: Optimized footer layout.
 * [2025-11-23 14:50:00] V24: Fixed theme switcher.
 * -----------------------------------------------------------------------------
 */

/* ==========================================================================
   1. Header & Navigation (头部与导航)
   ========================================================================== */

.site-header {
    background: var(--surface);
    height: var(--header-height);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: var(--container-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.site-logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
    text-decoration: none;
    z-index: 10;
    white-space: nowrap;
    flex-shrink: 0;
    padding-right: 60px;
}

/* --- 桌面端导航 --- */
.site-nav {
    height: 100%;
    display: flex;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.site-nav>ul {
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
    height: 100%;
    align-items: center;
}

.site-nav>ul>li {
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.site-nav a {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--primary);
}

/* --- 下拉菜单 --- */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--surface);
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.site-nav li.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.dropdown-menu li {
    height: auto;
    display: block;
    width: 100%;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    white-space: nowrap;
    color: var(--text-main);
    width: 100%;
}

.dropdown-menu a:hover {
    background: var(--background);
    color: var(--primary);
}

/* --- 移动端汉堡按钮 --- */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--text-main);
    z-index: 1001;
    flex-shrink: 0;
    margin-left: auto;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: flex-end;
}

@media (min-width: 993px) {
    .mobile-nav-toggle {
        display: none !important;
    }
}

.mobile-nav-toggle svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
}

/* --- 响应式适配 --- */
@media (max-width: 992px) {
    .mobile-nav-toggle {
        display: flex;
    }

    .site-logo {
        font-size: 1.3rem;
        max-width: 70%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .site-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        transform: none;
        width: 100%;
        background: var(--surface);
        padding: 20px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        height: auto;
        display: block;
        transform: translateY(-150%);
        transition: transform 0.3s ease-in-out;
        z-index: 999;
    }

    .site-nav[data-visible="true"] {
        transform: translateY(0);
    }

    .site-nav>ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        height: auto;
    }

    .site-nav>ul>li {
        width: 100%;
        height: auto;
        border-bottom: 1px solid var(--border-color);
        display: block;
    }

    .site-nav a {
        display: block;
        padding: 15px 0;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        padding: 0 0 0 20px;
        min-width: auto;
        pointer-events: auto;
        display: block;
        background: transparent;
    }

    .dropdown-menu a {
        padding: 10px 0;
        font-size: 0.9rem;
        color: var(--text-muted);
    }
}


/* ==========================================================================
   2. Instrument Stage & Layout
   ========================================================================== */

main.container>section {
    margin-top: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

main.container article {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    padding-top: 20px !important;
    padding-bottom: 20px !important;
}

main.container>section:first-child>article {
    margin-top: 10px !important;
}

main.container {
    margin-top: 10px !important;
    padding-top: 0 !important;
}

.app-main-title {
    margin-top: 0 !important;
    margin-bottom: 15px;
    font-size: 2rem;
    line-height: 1.2;
}

#instrument-stage {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    height: 460px !important;
    padding-bottom: 40px !important;
    width: 100%;
    margin-bottom: 0;
    user-select: none;
    overflow-x: auto !important;
    overflow-y: auto !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

#instrument-stage.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.15);
    z-index: 50;
    border-radius: 12px;
}

[data-theme="dark"] #instrument-stage.loading::after {
    background: rgba(0, 0, 0, 0.3);
}

#instrument-stage.loading::before {
    content: "🎵 Loading Sounds...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 51;
    color: var(--primary, #ff3e6c);
    font-size: 1.15rem;
    font-weight: 700;
    font-family: var(--font-inter, 'Inter'), sans-serif;
    letter-spacing: 0.5px;
    background: var(--bg-surface, #ffffff);
    padding: 14px 28px;
    border-radius: 50px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--border-color, rgba(0, 0, 0, 0.05)) inset;
    animation: bounce-load 1s cubic-bezier(0.2, 0.8, 0.2, 1) infinite alternate;
}

@keyframes bounce-load {
    0% {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 1;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--border-color, rgba(0, 0, 0, 0.05)) inset;
    }
}

.tine-wrapper {
    flex: 1;
    max-width: 60px;
    min-width: 12px;
    margin: 0 1px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    position: relative;
    transition: height 0.3s ease;
}

.tine-bar {
    width: 100%;
    height: 100%;
    border-radius: 0 0 15px 15px;
    cursor: pointer;
    background: linear-gradient(to bottom, #eef2f3 0%, #cbe2ed 20%, #2980b9 100%);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2), inset 0 -5px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 15px;
    transition: transform 0.1s, filter 0.1s;
}

.tine-bar.hit {
    transform: scaleY(0.96) translateY(2px);
    filter: brightness(1.1);
    background: linear-gradient(to bottom, #fff 0%, var(--primary) 100%);
}

.k-num {
    font-size: 1.4rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
    line-height: 1;
}

.k-note {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    font-weight: 600;
}

.k-char {
    position: absolute;
    top: 10px;
    font-size: 0.7rem;
    color: #888;
    font-weight: bold;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .k-num {
        font-size: 1rem;
    }

    .k-note {
        font-size: 0.6rem;
    }

    .k-char {
        display: none;
    }

    #instrument-stage {
        height: 300px;
    }

    .app-main-title {
        font-size: 1.5rem;
    }
}


/* ==========================================================================
   3. Controls (Buttons)
   ========================================================================== */

.buttons-wrapper-center {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 20px;
    text-align: center;
}

@media (max-width: 992px) {
    .buttons-wrapper-center {
        margin-top: 60px !important;
    }

    main.container article {
        margin-bottom: 15px !important;
        padding-top: 15px !important;
    }
}

.buttons-container {
    background: var(--background);
    padding: 15px 30px;
    border-radius: 60px;
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin: 0 auto;
}

.button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-main);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.2s;
    padding: 0;
    flex-shrink: 0;
    margin: 0;
}

.button:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
    border-color: var(--primary);
}

.button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    background: #f0f0f0;
}

.button svg {
    width: 24px;
    height: 24px;
    display: block;
    stroke: currentColor;
    fill: none;
}

#action-record svg {
    fill: #e74c3c;
    stroke: none;
}

#action-record:hover svg {
    fill: #fff;
}

.button.recording-now {
    background: #ffebeb !important;
    border-color: #ff4d4f !important;
    animation: pulse-red 1.5s infinite;
}

.button.recording-now svg {
    fill: #ff4d4f !important;
    stroke: none !important;
}

#icon-spin {
    stroke: #ff4d4f !important;
    fill: none !important;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.4);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(255, 77, 79, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 77, 79, 0);
    }
}

.text-button {
    width: auto;
    height: 48px;
    padding: 0 24px;
    border-radius: 30px;
    font-weight: 700;
    gap: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.buttons-separator {
    width: 1px;
    height: 28px;
    background: #cbd5e0;
    margin: 0 5px;
}


/* ==========================================================================
   4. Settings Layout
   ========================================================================== */

#options-panel h2 {
    text-align: center;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 10px;
    margin-bottom: 30px;
    display: inline-block;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    text-align: left;
}

fieldset {
    border: 1px solid var(--border-color);
    background: var(--surface);
    padding: 20px;
    border-radius: var(--radius);
    margin: 0;
    min-width: 0;
    width: 100%;
}

fieldset label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
}

input[type=range] {
    width: 100%;
    cursor: pointer;
}

select {
    width: 100%;
    padding: 5px;
}

.radio-group {
    display: flex;
    gap: 15px;
}

.radio-group label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

/* Tune Keys */
.tune-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.tune-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 24px;
}

.tune-item input[type=range] {
    -webkit-appearance: none;
    writing-mode: vertical-lr;
    direction: rtl;
    width: 4px;
    height: 70px;
    background: #e0e0e0;
    border-radius: 2px;
    margin: 5px 0;
}

.tune-item input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #009688;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    margin-left: -5px;
}

.tune-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
}

/* Visual Keyboard */
.keyboard-map {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f0f2f5;
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
    overflow-x: auto;
}

.kb-row {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
    white-space: nowrap;
}

.kb-key {
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.75rem;
    color: #555;
}

.kb-key.active-map {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.kb-key.pressed {
    background: #e74c3c;
    color: white;
    transform: scale(0.9);
}

#customization {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding-top: 15px;
}

.color-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.grid-span-3 {
    grid-column: span 3;
}

.grid-span-2 {
    grid-column: span 2;
}

/* --- 手机端适配 (Settings) --- */
@media (max-width: 992px) {
    .options-grid {
        display: block;
    }

    fieldset {
        margin-bottom: 20px;
        width: 100%;
        box-sizing: border-box;
    }

    .grid-span-3,
    .grid-span-2 {
        grid-column: span 1;
    }

    .option-scheme,
    #visual-keyboard {
        display: none !important;
    }

    .tune-container {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding-bottom: 10px;
    }

    #main-container {
        padding: 20px;
    }
}


/* ==========================================================================
   5. Footer (V26 列表去点修复)
   ========================================================================== */

.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    padding: 50px 0 0 0;
    margin-top: 50px;
    text-align: center;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding: 50px 20px 40px 20px;
    max-width: var(--container-width);
    margin: 0 auto;
}

.footer-col h4 {
    color: var(--text-main);
    margin-bottom: 20px;
    font-weight: 700;
}

/* V26 核心修复：暴力去除列表点 */
.footer-col ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.footer-col li {
    list-style: none !important;
    /* 双重保险 */
    list-style-type: none !important;
    margin-bottom: 10px;
}

.footer-col a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: var(--primary);
}

/* 底部版权栏 */
.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.02);
    margin-top: 20px;
}


/* ==========================================================================
   6. Modal & Sheet Music
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal-card {
    background: var(--surface);
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    position: relative;
}

.modal-header {
    background: var(--primary);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.modal-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 5px;
    transition: opacity 0.2s;
    flex: 0 0 auto;
    width: auto;
}

.modal-close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.score-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.score-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.score-item:hover {
    background: var(--background);
}

.score-icon {
    color: var(--primary);
    display: flex;
    align-items: center;
}

.score-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1rem;
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.score-scroll-wrapper {
    overflow-x: auto;
    white-space: nowrap;
    padding: 20px 10px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
    text-align: center;
    margin-top: 20px;
}

#sheet-render {
    display: inline-block;
}

.n-node {
    display: inline-block;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.2rem;
    color: #333;
    background: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    margin: 0 4px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    min-width: 30px;
    text-align: center;
    transition: all 0.2s;
}

.n-node.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.n-node.correct {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.n-node.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
    animation: shake 0.4s;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }

    100% {
        transform: translateX(0);
    }
}

.sep {
    font-style: normal;
    color: #bbb;
    margin: 0 10px;
    font-size: 1.2rem;
    font-weight: 300;
}

.score-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    gap: 15px;
    width: 100%;
}

.score-header-row h4 {
    margin: 0;
    flex: 1;
    min-width: 0;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.tiny-btn {
    padding: 4px 10px;
    font-size: 1rem;
    background: transparent;
    border: 1px solid #ccc;
    cursor: pointer;
    color: var(--text-muted);
    flex: 0 0 auto;
    width: auto !important;
}

/* Theme Switcher */
.theme-switcher {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1002;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--text-main);
    color: var(--surface);
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.theme-switcher i {
    font-style: normal;
    font-weight: bold;
    font-size: 0.8rem;
}

/* --- DYNAMIC VISUAL EMITTER PARTICLES --- */
.note-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%) scale(0.5);
    pointer-events: none;
    z-index: 100;
    font-size: 1.5rem;
    color: var(--primary, #fff);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    opacity: 1;
    transition: transform 1s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 1s ease-out, filter 1s linear;
    filter: blur(0px);
}

.note-particle.float-up {
    transform: translateX(-50%) translateY(-140px) scale(1.5) rotate(15deg) !important;
    opacity: 0;
    filter: blur(2px);
}

/* --- INTERACTIVE MASCOT --- */
#kalimba-mascot {
    position: absolute;
    z-index: 100 !important;
    top: 50%;
    bottom: auto;
    left: 50%;
    margin-top: 184px;
    /* Perfectly aligns with bottom rim regardless of height */
    transform: translate(-50%, 0);
    width: 65px;
    height: 65px;
    background: var(--bg-surface, #ffffff);
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    /* Ambient shadow */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.1s ease-out, border-color 0.1s ease-out, background-color 0.1s ease-out, margin 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 50;
    pointer-events: none;
    animation: happy-dance 1.2s infinite ease-in-out;
}

#kalimba-mascot.mascot-dodging {
    transition: box-shadow 0.1s ease-out, border-color 0.1s ease-out, background-color 0.1s ease-out, margin 0.05s linear !important;
}

#kalimba-mascot .mascot-eyes {
    display: flex;
    gap: 16px;
    margin-bottom: 6px;
    transition: transform 0.1s ease-out;
    /* optimized for fast JS cursor injection */
    z-index: 2;
}

@keyframes eye-blink {

    0%,
    96% {
        transform: scaleY(1);
    }

    98% {
        transform: scaleY(0.1);
    }

    100% {
        transform: scaleY(1);
    }
}

#kalimba-mascot .eye {
    width: 8px;
    height: 8px;
    background-color: var(--text-main);
    border-radius: 50%;
    animation: eye-blink 3.5s infinite;
    transition: all 0.08s ease-out;
}

@keyframes mouth-dance {

    0%,
    100% {
        transform: scaleX(1) scaleY(1);
    }

    50% {
        transform: scaleX(1.15) scaleY(0.85);
    }
}

#kalimba-mascot .mascot-mouth {
    width: 14px;
    height: 6px;
    border: 3px solid var(--text-main);
    border-top: none;
    border-radius: 0 0 10px 10px;
    animation: mouth-dance 1.4s infinite ease-in-out;
    transition: all 0.08s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dynamics & Resonance */
#kalimba-mascot.mascot-playing,
#kalimba-mascot.mascot-playing-high {
    /* energetic swell removed to allow @keyframes to control Y axis */
    box-shadow: 0 0 0 12px rgba(94, 106, 210, 0.15), 0 0 0 24px rgba(94, 106, 210, 0.05), 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
    transition: box-shadow 0.05s ease-out, border-color 0.05s ease-out, background-color 0.05s ease-out;
}

#kalimba-mascot.mascot-playing {
    border-color: color-mix(in srgb, #ff3e6c calc(var(--pitch-intensity, 0) * 100%), var(--primary)) !important;
    background-color: color-mix(in srgb, #fff0f4 calc(var(--pitch-intensity, 0) * 100%), var(--bg-card)) !important;
    animation: dynamic-note-jump 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

@keyframes dynamic-note-jump {
    0% {
        transform: translate(-50%, -8px) scale(1);
        box-shadow: none;
    }

    50% {
        transform: translate(-50%, calc(-8px - (12px * var(--pitch-intensity, 0)))) scale(calc(1 + (0.15 * var(--pitch-intensity, 0)))) rotate(calc(5deg * var(--pitch-intensity, 0)));
        box-shadow: 0 calc(15px * var(--pitch-intensity, 0)) calc(30px * var(--pitch-intensity, 0)) rgba(255, 60, 110, calc(0.25 * var(--pitch-intensity, 0)));
    }

    100% {
        transform: translate(-50%, -8px) scale(1);
        box-shadow: none;
    }
}

#kalimba-mascot.mascot-playing .mascot-mouth {
    height: calc(10px + (6px * var(--pitch-intensity, 0))) !important;
    width: calc(14px + (6px * var(--pitch-intensity, 0))) !important;
    border-radius: 2px 2px 14px 14px !important;
    background-color: #ff6b81 !important;
    border: 3px solid var(--text-main) !important;
    transition: none !important;
}

#kalimba-mascot.mascot-playing .eye {
    height: calc(10px + (10px * var(--pitch-intensity, 0))) !important;
    width: calc(8px + (8px * var(--pitch-intensity, 0))) !important;
    background-color: var(--text-main) !important;
    border: none !important;
    border-radius: 50% !important;
    position: relative !important;
    transform: translateY(calc(0px - (2px * var(--pitch-intensity, 0)))) !important;
    transition: none !important;
    animation: none !important;
}

#kalimba-mascot.mascot-playing .eye::after {
    content: '' !important;
    position: absolute !important;
    top: 2px !important;
    left: calc(1px + (2px * var(--pitch-intensity, 0))) !important;
    width: calc(4px + (2px * var(--pitch-intensity, 0))) !important;
    height: calc(4px + (3px * var(--pitch-intensity, 0))) !important;
    background-color: white !important;
    border-radius: 50% !important;
}

/* CUTEST NAUGHTY TONGUE TEASE (😜) */
#kalimba-mascot.mascot-tease .mascot-mouth {
    height: 6px !important;
    width: 6px !important;
    border: none !important;
    border-radius: 50% !important;
    background-color: var(--text-main) !important;
    transform: scale(1.2) rotate(-5deg) !important;
}

#kalimba-mascot.mascot-tease .mascot-mouth::after {
    content: '';
    position: absolute;
    bottom: -4px;
    right: -2px;
    left: auto;
    transform-origin: top center;
    transform: scaleY(0) rotate(-15deg);
    width: 6px;
    height: 10px;
    background-color: #ff6b81;
    border-radius: 2px 2px 10px 10px;
    z-index: 10;
    box-shadow: inset -2px 0 0 rgba(0, 0, 0, 0.05);
    animation: cute-naughty-flick 0.4s cubic-bezier(0.3, 1.5, 0.4, 1) forwards;
}

#kalimba-mascot.mascot-tease .eye {
    height: 10px !important;
    width: 14px !important;
    background-color: transparent !important;
    border: solid var(--text-main) !important;
    border-width: 4px 0 0 0 !important;
    border-radius: 50% !important;
    transform: translateY(-2px) !important;
}

@keyframes cute-naughty-flick {
    0% {
        transform: scaleY(0) rotate(-15deg);
    }

    100% {
        transform: scaleY(1) rotate(-15deg);
    }
}

/* MASCOT INTERACTIVE SPEECH BUBBLES */
.mascot-speech {
    position: absolute;
    bottom: 50px;
    left: -30px;
    background-color: var(--bg-card, #ffffff);
    color: var(--text-main, #333333);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border: 2px solid var(--text-main, #333);
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 100;
}

.mascot-speech.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.mascot-speech::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    margin-left: -5px;
    width: 10px;
    height: 10px;
    background-color: var(--bg-card, #ffffff);
    border-bottom: 2px solid var(--text-main, #333);
    border-right: 2px solid var(--text-main, #333);
    transform: rotate(45deg);
}

/* KISS FOUNTAIN EFFECT (Tease Reaction) */
#kalimba-mascot.mascot-tease::before,
#kalimba-mascot.mascot-tease::after,
#kalimba-mascot.mascot-tease .mascot-mouth::before {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

#kalimba-mascot.mascot-tease::before {
    content: '💋';
    top: -10px;
    right: -5px;
    font-size: 20px;
    animation: float-star1 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

#kalimba-mascot.mascot-tease::after {
    content: '💖';
    top: 5px;
    left: -15px;
    font-size: 14px;
    animation: float-star2 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 0.1s;
}

#kalimba-mascot.mascot-tease .mascot-mouth::before {
    content: '😘';
    top: -20px;
    left: -10px;
    font-size: 24px;
    animation: float-star3 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 0.2s;
}

/* MUSIC & HEART FOUNTAIN EFFECT (Playing Reaction) */
#kalimba-mascot.mascot-playing::before,
#kalimba-mascot.mascot-playing::after {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

#kalimba-mascot.mascot-playing::before {
    content: '🎶';
    top: -10px;
    left: -15px;
    font-size: 14px;
    animation: play-float-loop 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

#kalimba-mascot.mascot-playing::after {
    content: '💕';
    top: 0px;
    right: -20px;
    font-size: 14px;
    animation: play-float-loop-alt 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) infinite 0.3s;
}

@keyframes play-float-loop {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: translateY(-30px) scale(1.2);
        opacity: 0;
    }
}

@keyframes play-float-loop-alt {
    0% {
        transform: translateY(0) scale(0.5) rotate(15deg);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: translateY(-25px) scale(1.2) rotate(-15deg);
        opacity: 0;
    }
}



@keyframes float-star1 {
    0% {
        transform: scale(0) translate(0, 0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: scale(1.2) translate(15px, -35px) rotate(45deg);
        opacity: 0;
    }
}

@keyframes float-star2 {
    0% {
        transform: scale(0) translate(0, 0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: scale(1) translate(-20px, -40px) rotate(-45deg);
        opacity: 0;
    }
}

@keyframes float-star3 {
    0% {
        transform: scale(0) translate(0, 0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: scale(1.1) translate(5px, -45px) rotate(90deg);
        opacity: 0;
    }
}

/* KISSING EFFECT (Alternate Evasion Reaction) */
#kalimba-mascot.mascot-kiss .mascot-mouth {
    height: 6px !important;
    width: 6px !important;
    border: none;
    border-radius: 50%;
    background-color: var(--text-main);
    transform: scale(1.2);
}

#kalimba-mascot.mascot-kiss .eye {
    height: 10px !important;
    width: 14px !important;
    background-color: transparent !important;
    border: solid var(--text-main);
    border-width: 4px 0 0 0 !important;
    border-radius: 50% !important;
    transform: translateY(-2px) !important;
}

#kalimba-mascot.mascot-kiss::before,
#kalimba-mascot.mascot-kiss::after,
#kalimba-mascot.mascot-kiss .mascot-mouth::before,
#kalimba-mascot.mascot-kiss .mascot-mouth::after {
    content: '❤';
    position: absolute;
    color: #ff3e6c;
    opacity: 0;
    pointer-events: none;
}

#kalimba-mascot.mascot-kiss::before {
    top: -10px;
    right: -5px;
    font-size: 20px;
    animation: float-h1 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

#kalimba-mascot.mascot-kiss::after {
    top: 5px;
    left: -15px;
    font-size: 14px;
    color: #ff6b81;
    animation: float-h2 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 0.1s;
}

#kalimba-mascot.mascot-kiss .mascot-mouth::before {
    top: -20px;
    left: -10px;
    font-size: 24px;
    color: #ff1a53;
    border-radius: 0 !important;
    height: auto !important;
    width: auto !important;
    background: transparent !important;
    animation: float-h3 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 0.2s;
}

#kalimba-mascot.mascot-kiss .mascot-mouth::after {
    top: -5px;
    right: -25px;
    font-size: 16px;
    border-radius: 0 !important;
    height: auto !important;
    width: auto !important;
    background: transparent !important;
    animation: float-h4 1.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards 0.05s;
}

@keyframes float-h1 {
    0% {
        transform: scale(0) translate(0, 0);
        opacity: 1;
    }

    100% {
        transform: scale(1.2) translate(15px, -35px) rotate(15deg);
        opacity: 0;
    }
}

@keyframes float-h2 {
    0% {
        transform: scale(0) translate(0, 0);
        opacity: 1;
    }

    100% {
        transform: scale(1) translate(-20px, -40px) rotate(-20deg);
        opacity: 0;
    }
}

@keyframes float-h3 {
    0% {
        transform: scale(0) translate(0, 0);
        opacity: 1;
    }

    100% {
        transform: scale(1.1) translate(5px, -45px) rotate(5deg);
        opacity: 0;
    }
}

@keyframes float-h4 {
    0% {
        transform: scale(0) translate(0, 0);
        opacity: 1;
    }

    100% {
        transform: scale(1.4) translate(30px, -25px) rotate(25deg);
        opacity: 0;
    }
}

/* FLOATING COMPANION MODE (Studio Scrolled Out of View) */
#kalimba-mascot.mascot-floating {
    position: fixed !important;
    top: auto !important;
    left: auto !important;
    bottom: 40px !important;
    right: 40px !important;
    margin: 0 !important;
    margin-right: calc(0px - var(--dodge-x, 0px)) !important;
    margin-bottom: calc(0px - var(--dodge-y, 0px)) !important;
    z-index: 9999 !important;
}

#kalimba-mascot.mascot-floating:not(.mascot-playing) {
    translate: 0 0;
    animation: companion-float 6s ease-in-out infinite alternate !important;
}

@keyframes companion-float {
    0% {
        translate: 0px 0px;
    }

    33% {
        translate: -15px -20px;
    }

    66% {
        translate: -30px 10px;
    }

    100% {
        translate: -10px -15px;
    }
}

/* Replaced CSS look sequences with active Javascript Cartesian Tracking */

@keyframes happy-dance {
    0% {
        transform: translate(-50%, 0) rotate(-5deg);
    }

    50% {
        transform: translate(-50%, -8px) rotate(5deg);
    }

    100% {
        transform: translate(-50%, 0) rotate(-5deg);
    }
}

@media (max-height: 550px) and (orientation: landscape) {
    #instrument-stage {
        height: 250px !important;
        padding-bottom: 20px !important;
        margin-top: 20px !important;
    }
}