/* klutzyplayer — one stylesheet, many skins.
   Layout/behaviour lives in the BASE section. Each skin is a block scoped
   to .mp[data-skin="name"]. To add a style: copy a block, rename it, and
   add { id: "name", label: "Name" } to SKINS in klutzyplayer.js. */

*, *::before, *::after {
    box-sizing: border-box
}

/* ================= BASE (shared by every skin) ================= */
.mp-wrap {
    width: 240px;
    margin: 0 auto 16px
}

.mp {
    position: relative;
    display: block;
    width: 240px;
    height: 240px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    color: #fff
}

.cover {
    position: absolute;
    inset: 0;
    background: #2b2a38 center/cover no-repeat
}

.overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    opacity: 1;
    transition: opacity .2s linear
}

.playing .overlay {
    opacity: 0
}

button {
    border: 0;
    padding: 0;
    background: none;
    color: inherit;
    cursor: pointer;
    font: inherit
}

button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px
}

/* transport buttons: skins set size, position and drawing */
.play, .nav {
    position: absolute;
    transition: transform .1s, filter .1s, opacity .2s
}

.play:hover, .nav:hover {
    transform: scale(1.1)
}

.play:active, .nav:active {
    transform: scale(.93)
}

.nav {
    opacity: 0;
    pointer-events: none
}

.started .nav {
    opacity: 1;
    pointer-events: auto
}

.play::before, .play::after, .nav::before, .nav::after {
    content: "";
    position: absolute
}

/* seek bar: skins set position/look; the range input is always the hit area */
.seek {
    --pn: 0;
    position: absolute;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s
}

.started .seek {
    opacity: 1;
    pointer-events: auto
}

.seek-track, .seek-fill {
    position: absolute
}

.seek-input {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    background: none;
    cursor: pointer
}

.seek-input::-webkit-slider-runnable-track {
    background: transparent
}

.seek-input::-moz-range-track {
    background: transparent
}

.seek-input:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px
}

.info, .time {
    position: absolute;
    top: 4px;
    background: rgba(24, 23, 33, .8);
    border-radius: 6px;
    padding: 6px;
    font-size: 12px;
    opacity: 0;
    transition: opacity .2s;
    z-index: 4
}

.info {
    left: 4px;
    width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.time {
    right: 4px;
    color: #cdd1db
}

.playing .info, .playing .time {
    opacity: 1
}

/* The track-name chip doubles as the style-switch button (easter egg).
   It's only clickable while playing, when it's visible; otherwise its invisible
   (opacity 0) box would still allow clicks. text-align resets the centering
   that browsers apply to <button> elements. */
.info { pointer-events: none }
.playing .info { pointer-events: auto; cursor: pointer }

/*Image shown while hovering the track name chip*/
.hint {
    position: absolute;
    /*left: 4px;
    top: 36px;
    width: 64px;
    height: 64px;*/
    left: 80px;
    top: 36px;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: url("/linkh2o/images/you-found-a-secret-sparkle.gif") center/cover no-repeat;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
    z-index: 4;
}
.info:hover ~ .hint,
.info:focus-visible ~ .hint { opacity: 1 }

.list {
    position: absolute;
    left: 15px;
    right: 15px;
    bottom: 10px;
    height: 90px;
    overflow-y: auto
}

.started .list {
    display: none
}

.row {
    display: block;
    width: 100%;
    height: 30px;
    line-height: 27px;
    padding-left: 5px;
    font-size: 12px;
    font-weight: 300;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.row.active {
    color: #ff3000
}

/* style switch button (sits under the player) */
.skin-btn {
    display: block;
    margin: 8px auto 0;
    padding: 5px 12px;
    border-radius: 12px;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    background: #2b2a38;
    color: #cdd1db;
    font-size: 12px
}

.skin-btn:hover {
    background: #3a3950
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important
    }
}


/* ================= SKIN: metal ================= */
.mp[data-skin="metal"] {
    --silver: linear-gradient(180deg, #e6e6e6, #a9a9a9);
    --knob: conic-gradient(from 0deg, #cfcfcf, #fff, #9a9a9a, #f0f0f0, #b5b5b5, #fff, #8e8e8e, #e4e4e4, #cfcfcf)
}

[data-skin="metal"] .play:active, [data-skin="metal"] .nav:active {
    filter: brightness(.8)
}

[data-skin="metal"] .play::before, [data-skin="metal"] .play::after,
[data-skin="metal"] .nav::before, [data-skin="metal"] .nav::after {
    top: 0;
    height: 100%;
    background: var(--silver)
}

[data-skin="metal"] .play {
    inset: 0;
    margin: auto;
    top: 17.5px;
    width: 48px;
    height: 48px
}

[data-skin="metal"] .play::before, [data-skin="metal"] .play::after {
    width: 32%
}

[data-skin="metal"] .play::before {
    left: 0
}

[data-skin="metal"] .play::after {
    right: 0
}

[data-skin="metal"] .play.is-play::before {
    left: 8%;
    width: 92%;
    clip-path: polygon(0 0, 100% 50%, 0 100%)
}

[data-skin="metal"] .play.is-play::after {
    display: none
}

[data-skin="metal"] .nav {
    top: 105px;
    width: 44px;
    height: 30px
}

[data-skin="metal"] .nav::before, [data-skin="metal"] .nav::after {
    width: 50%
}

[data-skin="metal"] .nav::before {
    left: 0
}

[data-skin="metal"] .nav::after {
    left: 46%
}

[data-skin="metal"] .prev {
    left: 14px
}

[data-skin="metal"] .next {
    right: 14px
}

[data-skin="metal"] .prev::before, [data-skin="metal"] .prev::after {
    clip-path: polygon(100% 0, 100% 100%, 0 50%)
}

[data-skin="metal"] .next::before, [data-skin="metal"] .next::after {
    clip-path: polygon(0 0, 100% 50%, 0 100%)
}

[data-skin="metal"] .seek {
    left: 16px;
    right: 16px;
    bottom: 16px;
    height: 14px
}

[data-skin="metal"] .seek-track {
    inset: 0;
    border-radius: 7px;
    background: linear-gradient(180deg, #050505, #121212);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, .9), 0 1px 0 rgba(150, 160, 190, .5)
}

[data-skin="metal"] .seek-fill {
    left: 2px;
    top: 2px;
    height: 10px;
    border-radius: 5px;
    width: calc(13px + (100% - 30px) * var(--pn));
    background: linear-gradient(180deg, #e9e9eb 0%, #dbdbdb 35%, #898a8c 100%);
    box-shadow: 0 0 0 1px rgba(28, 28, 28, .95), 0 1px 3px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .5)
}

[data-skin="metal"] .seek-input {
    height: 14px
}

[data-skin="metal"] .seek-input:focus-visible {
    border-radius: 7px
}

[data-skin="metal"] .seek-input::-webkit-slider-runnable-track {
    height: 14px
}

[data-skin="metal"] .seek-input::-moz-range-track {
    height: 14px
}

[data-skin="metal"] .seek-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 30px;
    height: 30px;
    margin-top: -8px;
    border-radius: 50%;
    border: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, .35), transparent 60%), var(--knob);
    box-shadow: 0 3px 8px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(255, 255, 255, .4)
}

[data-skin="metal"] .seek-input::-moz-range-thumb {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, .35), transparent 60%), var(--knob);
    box-shadow: 0 3px 8px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(255, 255, 255, .4)
}


/* ================= SKIN: classic (flat, red) ================= */
[data-skin="classic"] .play {
    left: 86px;
    top: 86px;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #ff3000
}

[data-skin="classic"] .play::before, [data-skin="classic"] .play::after {
    background: #fff
}

/* pause bars */
[data-skin="classic"] .play::before {
    left: 24px;
    top: 22px;
    width: 7px;
    height: 24px
}

[data-skin="classic"] .play::after {
    left: 37px;
    top: 22px;
    width: 7px;
    height: 24px
}

/* play triangle */
[data-skin="classic"] .play.is-play::before {
    left: 27px;
    top: 21px;
    width: 22px;
    height: 26px;
    clip-path: polygon(0 0, 100% 50%, 0 100%)
}

[data-skin="classic"] .play.is-play::after {
    display: none
}

[data-skin="classic"] .nav {
    top: 94px;
    width: 51px;
    height: 51px;
    border-radius: 50%;
    background: rgba(24, 23, 33, .8)
}

[data-skin="classic"] .nav::before, [data-skin="classic"] .nav::after {
    background: #fff;
    top: 15px;
    height: 21px
}

[data-skin="classic"] .prev {
    left: 13px
}

[data-skin="classic"] .next {
    right: 13px
}

[data-skin="classic"] .prev::before {
    left: 18px;
    width: 12px;
    clip-path: polygon(100% 0, 100% 100%, 0 50%)
}

[data-skin="classic"] .prev::after {
    left: 16px;
    width: 2.5px
}

[data-skin="classic"] .next::before {
    left: 21px;
    width: 12px;
    clip-path: polygon(0 0, 100% 50%, 0 100%)
}

[data-skin="classic"] .next::after {
    left: 32.5px;
    width: 2.5px
}

[data-skin="classic"] .seek {
    left: 0;
    right: 0;
    top: 0;
    height: 5px
}

[data-skin="classic"] .seek-track {
    inset: 0;
    background: #424242
}

[data-skin="classic"] .seek-fill {
    left: 0;
    top: 0;
    height: 100%;
    width: calc(100% * var(--pn));
    background: #ff3000
}

/* taller invisible hit area so the 5px bar is easy to click */
[data-skin="classic"] .seek-input {
    height: 16px
}

[data-skin="classic"] .seek-input::-webkit-slider-runnable-track {
    height: 16px
}

[data-skin="classic"] .seek-input::-moz-range-track {
    height: 16px
}

[data-skin="classic"] .seek-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 1px;
    height: 16px;
    background: transparent;
    border: 0
}

[data-skin="classic"] .seek-input::-moz-range-thumb {
    width: 1px;
    height: 16px;
    background: transparent;
    border: 0
}