body {
    margin: 0;
    padding: 0;
    background: #F5E8DC;
    font-size: 14px;
    font-family: '微软雅黑', '宋体', sans-serif;
    color: #5C4033;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

a {
    color: #5C4033;
    font-size: 14px;
}

#main {
    width: 100%;
    height: 100%;
}

#wrap {
    position: relative;
    margin: 0 auto;
    width: 100%;
    height: calc(100vh - 65px);
    margin-top: 0;
}

#text {
    width: 400px;
    height: 425px;
    left: 60px;
    top: 80px;
    position: absolute;
    z-index: 10;
}

#code {
    display: none;
    font-size: 16px;
}

#clock-box {
    position: absolute;
    left: 60px;
    bottom: 30px;
    font-size: 28px;
    display: none;
    z-index: 10;
}

#clock-box a {
    font-size: 28px;
    text-decoration: none;
}

#clock {
    margin-left: 48px;
}

#clock .digit {
    font-size: 64px;
}

#canvas {
    margin: 0 auto;
    width: 100%;
    height: 100%;
    display: block;
}

#error {
    margin: 0 auto;
    text-align: center;
    margin-top: 60px;
    display: none;
}

.hand {
    cursor: pointer;
}

.say {
    margin-left: 5px;
}

.space {
    margin-right: 150px;
}

#lock-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.8s ease-in-out, opacity 0.8s;
}

#lock-screen.unlocked {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.lock-background {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #ffc5d3;
    background-image: radial-gradient(#ff9eb5 2px, transparent 2px), radial-gradient(#ff9eb5 2px, transparent 2px);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
}

.lock-container {
    position: relative;
    width: 340px;
    height: 420px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

.shackle {
    position: absolute;
    top: 0;
    width: 180px;
    height: 160px;
    border: 25px solid #e0e0e0;
    border-bottom: 0;
    border-radius: 100px 100px 0 0;
    z-index: 1;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center bottom;
}

.shackle.open {
    transform: translateY(-60px);
}

.lock-body {
    position: relative;
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, #ff8fa3 0%, #ff6b8b 100%);
    border-radius: 30px;
    z-index: 2;
    box-shadow: 0 10px 25px rgba(168, 62, 88, 0.3),
        inset 0 2px 5px rgba(255, 255, 255, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.lock-title {
    font-size: 20px;
    color: #fff;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.combination-dials {
    display: flex;
    gap: 15px;
    background: rgba(0, 0, 0, 0.1);
    padding: 15px;
    border-radius: 15px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.dial-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dial-display {
    width: 50px;
    height: 60px;
    background-color: #4a2c2a;
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5), 0 2px 2px rgba(255, 255, 255, 0.2);
    margin-bottom: 5px;
    font-family: monospace;
}

.dial-controls {
    display: flex;
    gap: 5px;
}

.arrow-btn {
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
}

.arrow-btn:hover {
    background: rgba(255, 255, 255, 0.6);
}

.arrow-btn:active {
    transform: scale(0.95);
}

.dial-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 5px;
    text-transform: uppercase;
}

.heart-btn {
    background: #fff;
    color: #ff6b8b;
    border: none;
    padding: 10px 30px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.heart-btn:hover {
    transform: scale(1.05);
    background: #fff0f5;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

#lock-message {
    margin-top: 15px;
    font-size: 14px;
    color: #fff;
    height: 20px;
    font-style: italic;
}

#player-container {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border-radius: 0;
    padding: 10px 18px;
    box-shadow: 0 -4px 18px rgba(255, 107, 139, 0.25);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    transition: opacity 1s ease, transform 1s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    box-sizing: border-box;
}

.player-hidden {
    opacity: 0;
    transform: translateY(100px);
    pointer-events: none;
}

.song-info {
    margin-bottom: 0;
    text-align: left;
    width: auto;
    max-width: 65%;
}

.song-title {
    font-size: 14px;
    color: #5C4033;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

.ctrl-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #ff6b8b;
    transition: all 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctrl-btn:hover {
    color: #ff477e;
    transform: scale(1.1);
}

.ctrl-btn.big {
    font-size: 32px;
    width: 45px;
    height: 45px;
    background: #ff6b8b;
    color: white;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(255, 107, 139, 0.4);
}

.ctrl-btn.big:hover {
    background: #ff477e;
    transform: scale(1.1) rotate(360deg);
    color: white;
}


@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    #wrap {
        height: 900px;
    }

    /* EL ÁRBOL Y EL SUELO */
    #canvas {
        display: block;
        margin: 0 auto;
        width: 1100px;
        height: 680px;
        /* Mantenemos tu ajuste de 80px para que se vea bien sobre el contador */
        transform: scale(0.4) translate(-850px, 80px);
        transform-origin: bottom center;
    }

    .space {
        margin-right: 50px;
    }

    /* TEXTO DE LA CARTA */
    #text {
        position: absolute;
        left: 24px;
        top: 60px;
        width: calc(100% - 48px);
        z-index: 2;
    }

    #lock-screen {
        align-items: center;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
    }

    /* EL CONTADOR / RELOJ */
    #clock-box {
        position: absolute;
        left: 20px;
        width: auto;
        text-align: left;
        top: auto;
        bottom: 90px;
        margin-top: 0;
        font-size: 20px;
        z-index: 2;
    }

    #clock {
        margin-left: 0;
    }

    #clock .digit {
        font-size: 32px;
    }

    .lock-container {
        transform: scale(1.15);
    }

    /* --- AJUSTES DEL REPRODUCTOR Y CANDADO --- */

    #player-container {
        flex-direction: column;
        align-items: center;
        /* Quitamos padding lateral para usar todo el ancho de la pantalla */
        padding: 10px 0;
        width: 100%;
    }

    .song-info {
        max-width: 90%;
        width: auto;
        text-align: center;
        margin-bottom: 8px;
    }

    .song-title {
        font-size: 16px;
    }

    /* CONTENEDOR DE LOS BOTONES */
    .controls {
        width: 100%;
        position: relative;
        /* IMPORTANTE: Para que el candado sepa dónde es "la derecha" */
        display: flex;
        justify-content: center;
        /* Esto asegura que el Play quede AL MEDIO */
        align-items: center;
    }

    .ctrl-btn {
        font-size: 22px;
        margin: 0 10px;
        /* Separación entre los botones de música */
    }

    .ctrl-btn.big {
        width: 56px;
        height: 56px;
        font-size: 34px;
    }

    /* EL BOTÓN DEL CANDADO (FLOTANTE) */
    #re-lock-btn {
        position: absolute;
        /* Lo sacamos de la fila para que no empuje */
        right: 20px;
        /* Lo pegamos a la derecha */
        top: 50%;
        /* Lo centramos verticalmente */
        transform: translateY(-50%);
        margin: 0 !important;
    }
}
}