/* MEth Drop (Record Player) Styles */
.record-player-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 2rem;
}

.record-player {
    width: min(760px, 92vw);
    height: min(520px, 76vh);
    background: var(--kirby-peach);
    border: calc(var(--px) * 2) solid var(--kirby-ink);
    box-shadow:
        0 0 0 var(--px) var(--kirby-pink),
        0 0 0 calc(var(--px) * 2) var(--kirby-ink),
        0 calc(var(--px) * 2) 0 var(--kirby-ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.record-display {
    position: relative;
    width: 100%;
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.record {
    width: 288px;
    height: 288px;
    background: var(--kirby-ink);
    border: var(--px) solid var(--kirby-ink);
    border-radius: 50%;
    position: relative;
    box-shadow:
        inset 0 0 0 var(--px) var(--kirby-pink),
        0 var(--px) 0 var(--kirby-ink);
    display: flex;
    align-items: center;
    justify-content: center;
}

.record::before {
    content: '';
    width: 96px;
    height: 96px;
    background: var(--kirby-yellow);
    border-radius: 50%;
    position: absolute;
    border: var(--px) solid var(--kirby-ink);
}

.record::after {
    content: '';
    width: 22px;
    height: 22px;
    background: var(--kirby-ink);
    border-radius: 50%;
    position: absolute;
    z-index: 2;
    border: 2px solid var(--kirby-cream);
}

.record-large {
    width: 312px;
    height: 312px;
    z-index: 2;
}

.record-small {
    width: 168px;
    height: 168px;
}

.record-side {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.9;
}

#prev-record {
    left: 10%;
}

#next-record {
    right: 10%;
}

.record-side.hidden {
    display: none;
}

.record.spinning {
    animation: spin 2s linear infinite;
}

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

.record-label {
    position: absolute;
    color: var(--kirby-blue);
    font-size: 0.9rem;
    text-align: center;
    max-width: 200px;
    word-wrap: break-word;
    z-index: 3;
    text-shadow:
        2px 2px 0 var(--kirby-white),
        -2px 2px 0 var(--kirby-white),
        2px -2px 0 var(--kirby-white),
        -2px -2px 0 var(--kirby-white);
    padding: 0 0.5rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.record-large .record-label {
    font-size: 1.1rem;
    max-width: 220px;
}

.record-small .record-label {
    font-size: 0.6rem;
    max-width: 120px;
}

.record-creator-info {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 0.65rem;
    z-index: 3;
    white-space: nowrap;
    pointer-events: auto;
}

.record-creator-label {
    color: var(--kirby-ink-soft);
    margin-right: 0.25rem;
}

.record-creator-link {
    color: var(--kirby-blue);
    text-decoration: underline;
    cursor: pointer;
    font-weight: bold;
}

.record-creator-link:hover {
    color: var(--kirby-pink-deep);
}

.player-controls {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.meth-controls {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

/* Piano integration */
#piano-container {
    margin-top: 2rem;
    background-color: var(--kirby-cream);
    padding: 1rem;
    border: calc(var(--px) * 2) solid var(--kirby-ink);
    box-shadow: 0 0 0 var(--px) var(--kirby-pink);
    max-width: 95vw;
}

/* Piano wrapper for keyboard and octave controls */
.piano-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Octave controls */
.octave-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: var(--kirby-peach);
    border: var(--px) solid var(--kirby-ink);
    border-radius: 4px;
}

.octave-btn {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.octave-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.octave-display {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--kirby-ink);
    min-width: 30px;
    text-align: center;
}

.set {
    padding-top: 10px;
    width: 100%;
    padding-bottom: 5px;
    white-space: nowrap;
    font-size: 0;
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    overflow-y: hidden;
    text-align: center;
}

.key {
    margin: 0;
    padding: 0;
    position: relative;
    display: inline-block;
    font-size: 13px;
    vertical-align: top;
    cursor: pointer;
}

.set .white {
    height: 150px;
    width: 3.5em;
    z-index: 1;
    border: var(--px) solid var(--kirby-ink);
    box-shadow: var(--px) var(--px) 0 var(--kirby-ink);
    background: var(--kirby-cream);
}

.white.active {
    background: var(--kirby-blue);
    border-color: var(--kirby-ink);
    box-shadow: 0 0 0 var(--px) var(--kirby-ink);
}

.black {
    height: 80px;
    width: 2.8em;
    margin: 0 0 100px -1.4em;
    z-index: 2;
    border: var(--px) solid var(--kirby-ink);
    box-shadow: var(--px) var(--px) 0 var(--kirby-ink);
    background: var(--kirby-ink);
}

.black.active {
    background: var(--kirby-pink-deep);
    box-shadow: 0 0 0 var(--px) var(--kirby-ink);
}

.a,
.c,
.d,
.f,
.g {
    margin: 0 0 0 -1.4em;
}

.white .note1,
.black .note1 {
    bottom: 10px;
    position: absolute;
    text-align: center;
    width: 100%;
    color: var(--kirby-ink-soft);
    font-size: 10px;
}

.black.active .note1 {
    color: var(--kirby-cream);
}

.piano-controls {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.piano-controls .nes-btn {
    font-size: 0.7rem;
    padding: 0.7rem 1.5rem;
}

.record-info {
    position: absolute;
    bottom: 20px;
    font-size: 0.7rem;
    color: var(--kirby-ink-soft);
    text-align: center;
}

.empty-records {
    text-align: center;
    color: var(--kirby-ink-soft);
    font-style: italic;
    font-size: 0.8rem;
    padding: 2rem;
}

/* Owner controls for records */
.record-owner-controls {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.record-owner-controls .delete-btn {
    background-color: var(--kirby-danger);
    color: var(--kirby-white);
}

.record-owner-controls .delete-btn:hover {
    background-color: var(--kirby-pink-deep);
}

.record-owner-controls .favorite-btn {
    background-color: var(--kirby-yellow);
    color: var(--kirby-ink);
}

.record-owner-controls .favorite-btn:hover {
    background-color: var(--kirby-mint);
}

/* Responsive styles */
@media (max-width: 900px) {
    .record-player-container {
        padding: 1.5rem;
    }

    .record-player {
        width: min(95vw, 700px);
        height: min(70vh, 480px);
        padding: 1.5rem;
    }

    .record-display {
        height: 320px;
        margin-bottom: 1rem;
    }

    .record {
        width: 240px;
        height: 240px;
    }

    .record::before {
        width: 80px;
        height: 80px;
    }

    .record::after {
        width: 18px;
        height: 18px;
    }

    .record-large {
        width: 260px;
        height: 260px;
    }

    .record-small {
        width: 140px;
        height: 140px;
    }

    .record-label {
        font-size: 0.8rem;
        max-width: 170px;
    }

    .record-large .record-label {
        font-size: 0.95rem;
        max-width: 190px;
    }

    .record-small .record-label {
        font-size: 0.55rem;
        max-width: 100px;
    }

    .player-controls,
    .meth-controls {
        margin-top: 1.5rem;
        gap: 0.8rem;
    }

    #piano-container {
        margin-top: 1.5rem;
        padding: 0.8rem;
    }

    .piano-wrapper {
        gap: 0.8rem;
    }

    .octave-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .octave-display {
        font-size: 1rem;
    }

    .set .white {
        height: 130px;
        width: 3em;
    }

    .black {
        height: 70px;
        width: 2.4em;
        margin: 0 0 100px -1.2em;
    }

    .a, .c, .d, .f, .g {
        margin: 0 0 0 -1.2em;
    }

    .piano-controls .nes-btn {
        font-size: 0.65rem;
        padding: 0.6rem 1.2rem;
    }
}

@media (max-width: 700px) {
    .record-player-container {
        padding: 1rem;
    }

    .record-player {
        width: 95vw;
        height: min(65vh, 420px);
        padding: 1rem;
    }

    .record-display {
        height: 260px;
        margin-bottom: 0.8rem;
    }

    .record {
        width: 200px;
        height: 200px;
    }

    .record::before {
        width: 66px;
        height: 66px;
    }

    .record::after {
        width: 15px;
        height: 15px;
    }

    .record-large {
        width: 210px;
        height: 210px;
    }

    .record-small {
        width: 110px;
        height: 110px;
    }

    .record-label {
        font-size: 0.7rem;
        max-width: 140px;
    }

    .record-large .record-label {
        font-size: 0.8rem;
        max-width: 150px;
    }

    .record-small .record-label {
        font-size: 0.5rem;
        max-width: 80px;
    }

    .record-creator-info {
        font-size: 0.55rem;
        bottom: -15px;
    }

    .player-controls,
    .meth-controls {
        margin-top: 1rem;
        gap: 0.6rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    #piano-container {
        margin-top: 1rem;
        padding: 0.6rem;
    }

    .piano-wrapper {
        gap: 0.5rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .octave-controls {
        flex-direction: row;
        padding: 0.4rem;
        gap: 0.3rem;
    }

    .octave-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .octave-display {
        font-size: 0.9rem;
    }

    .set .white {
        height: 110px;
        width: 2.5em;
    }

    .black {
        height: 60px;
        width: 2em;
        margin: 0 0 100px -1em;
    }

    .a, .c, .d, .f, .g {
        margin: 0 0 0 -1em;
    }

    .white .note1,
    .black .note1 {
        font-size: 8px;
    }

    .piano-controls .nes-btn {
        font-size: 0.6rem;
        padding: 0.5rem 1rem;
    }

    .record-info {
        font-size: 0.6rem;
        bottom: 15px;
    }

    .record-owner-controls {
        gap: 0.3rem;
    }
}

@media (max-width: 500px) {
    .record-player-container {
        padding: 0.75rem;
    }

    .record-player {
        height: min(60vh, 380px);
        padding: 0.75rem;
    }

    .record-display {
        height: 200px;
        margin-bottom: 0.5rem;
    }

    .record {
        width: 150px;
        height: 150px;
    }

    .record::before {
        width: 50px;
        height: 50px;
    }

    .record::after {
        width: 12px;
        height: 12px;
    }

    .record-large {
        width: 160px;
        height: 160px;
    }

    .record-small {
        width: 90px;
        height: 90px;
    }

    #prev-record {
        left: 5%;
    }

    #next-record {
        right: 5%;
    }

    .record-label {
        font-size: 0.6rem;
        max-width: 100px;
    }

    .record-large .record-label {
        font-size: 0.65rem;
        max-width: 110px;
    }

    .record-small .record-label {
        font-size: 0.4rem;
        max-width: 60px;
    }

    .record-creator-info {
        font-size: 0.5rem;
        bottom: -12px;
    }

    .player-controls,
    .meth-controls {
        margin-top: 0.75rem;
        gap: 0.4rem;
    }

    #piano-container {
        margin-top: 0.75rem;
        padding: 0.5rem;
    }

    .octave-btn {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .octave-display {
        font-size: 0.8rem;
    }

    .set .white {
        height: 90px;
        width: 2.2em;
    }

    .black {
        height: 50px;
        width: 1.7em;
        margin: 0 0 100px -0.85em;
    }

    .a, .c, .d, .f, .g {
        margin: 0 0 0 -0.85em;
    }

    .white .note1,
    .black .note1 {
        font-size: 7px;
        bottom: 5px;
    }

    .piano-controls .nes-btn {
        font-size: 0.55rem;
        padding: 0.4rem 0.8rem;
    }

    .record-info {
        font-size: 0.55rem;
        bottom: 10px;
    }

    .empty-records {
        font-size: 0.7rem;
        padding: 1rem;
    }
}
