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

* {
    margin: 0;
}

html {
    font-size: 62.5%;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    min-width: 100vw;
    background-color: #ffffff;
    font-family: neue-haas-unica, "Helvetica Neue", "Helvetica", "Arial", sans-serif;
    font-weight: 400;
    font-style: normal;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
}

/* ASCII Animation Background */
#ascii-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 110vw;
    height: 110vh;
    z-index: 0;
    pointer-events: none;
}

#ascii-art {
    font-family: ui-monospace, Menlo, "Courier New", monospace;
    color: rgba(0, 0, 0, 0.8);
    white-space: pre;
    text-align: left;
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
    opacity: 1.0;
    filter: contrast(120%);
}

#ascii-art::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(farthest-corner at 73% 17%, #7899edff 0%, #ffffff00 50%),
        radial-gradient(farthest-corner at 18% 78%, #ee7777ff 0%, #ffffff00 50%),
        radial-gradient(farthest-corner at 100% 100%, #06F8FBff 0%, #ffffff00 50%),
        radial-gradient(farthest-corner at 66% 52%, #9b9bf8ff 0%, #ffffff00 50%),
        radial-gradient(farthest-corner at 27% 26%, #eaaca4ff 0%, #ffffff00 50%),
        linear-gradient(to top, #e66bffff 0% 100%, #ffffff00 100%);
    background-size: 100% 100%;
    animation: gradientShift 10s ease-in-out infinite;
    opacity: 1.0;
    mix-blend-mode: multiply;
    filter: contrast(500%);
    pointer-events: none;
    z-index: 2;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
        filter: hue-rotate(0deg);
    }

    25% {
        background-position: 50% 0%;
        filter: hue-rotate(90deg);
    }

    50% {
        background-position: 100% 50%;
        filter: hue-rotate(180deg);
    }

    75% {
        background-position: 50% 100%;
        filter: hue-rotate(270deg);
    }

    100% {
        background-position: 0% 50%;
        filter: hue-rotate(360deg);
    }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition:
        background 0.5s,
        backdrop-filter 0.5s cubic-bezier(.4, 2, .6, 1),
        -webkit-backdrop-filter 0.5s cubic-bezier(.4, 2, .6, 1);
}

.modal.visible {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-form {
    display: flex;
    gap: 0.5em;
    align-items: center;
    justify-content: center;
    background: none;
}

.modal-input {
    width: 650px;
    max-width: 80vw;
    padding: 1em 1.1em;
    border: none;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.85);
    color: #000;
    font-size: 22px;
    outline: none;
}

.modal-input::placeholder {
    color: #888;
    font-weight: 400;
}

.modal-result {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding-top: 0.5em;
    text-align: center;
    color: #fff;
    font-size: 1em;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}
        
.shake {
    animation: shake 0.5s;
}

/* Center the embed container */
.center-embed {
    z-index: 10;
    position: relative;
    width: 800px;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    mix-blend-mode: lighten;
    transition: all 0.7s;
    filter: invert(0) grayscale(100%) contrast(200%) brightness(270%);
    background-color: rgba(0, 0, 0, 0.42);
    box-shadow:
        0 0 0 2.3vw rgba(0, 0, 0, 0.7),
        0 0 0 4.6vw rgba(255, 255, 255, 0.25),
        0 0 0 6.9vw rgba(255, 255, 255, 0);
}

.center-embed iframe {
    border-radius: 1rem;
    mix-blend-mode: multiply;
    transition: all 0.7s;
    image-rendering: crisp-edges;
}

.center-embed iframe:hover {
    mix-blend-mode: normal;
}

.center-embed:hover {
    background-color: rgba(0, 0, 0, 0.42);
    box-shadow:
        0 0 0 2.3vw rgba(0, 0, 0, 0.17),
        0 0 0 4.6vw rgba(0, 0, 0, 0.17),
        0 0 0 6.9vw rgba(0, 0, 0, 0.17);
    mix-blend-mode: normal;
    filter: invert(0) grayscale(0) contrast(100%) brightness(100%);
}

.corner-buttons {
    position: fixed;
    left: 32px;
    bottom: 32px;
    display: flex;
    gap: 18px;
    z-index: 20;
}

.icon-btn {
    width: 60px;
    height: 60px;
    padding: 0;
    margin: 0;
    border: none;
    outline: none;
    background: none;
    background-image: url('data:image/svg+xml,<svg width="263px" height="263px" viewBox="0 0 263 263" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="squircle-button" fill="%23FFFFFF" fill-rule="nonzero"><path d="M110.537176,256.370276 C41.0928498,256.370276 6.37067618,221.648103 6.37067618,152.203776 L6.37067618,110.537176 C6.37067618,41.0928498 41.0928498,6.37067618 110.537176,6.37067618 L152.203776,6.37067618 C221.648103,6.37067618 256.370276,41.0928498 256.370276,110.537176 L256.370276,152.203776 C256.370276,221.648103 221.648103,256.370276 152.203776,256.370276 L110.537176,256.370276 Z" id="Path" transform="translate(131.370476, 131.370476) rotate(3.000000) translate(-131.370476, -131.370476) "></path></g></g></svg>');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-color: transparent;
    font-size: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(0, 0, 0, 0.66);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    font-weight: normal;
}

.service-icons {
    position: fixed;
    top: 32px;
    right: 32px;
    z-index: 20;
    display: flex;
    gap: 18px;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.75);
    align-items: center;
}

.not-member-msg {
    z-index: 10;
    position: relative;
    padding: 2em;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    text-align: center;
    max-width: 600px;
}

.not-member-msg h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: #333;
}

.not-member-msg p {
    font-size: 1.6rem;
    color: #666;
    line-height: 1.5;
}

.message-box {
    z-index: 10;
    position: relative;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    text-align: center;
    max-width: 600px;
}

.message-box h2 {
    font-size: 2.0rem;
    margin-bottom: 1rem;
    color: #333;
}

.message-box p {
    font-size: 1.6rem;
    color: #666;
    line-height: 1.5;
}

.message-box .add-hint {
    margin-top: 1.5em;
    padding: 1em;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    font-size: 1.4rem;
    color: #555;
}

.message-box .kbd {
    display: inline-block;
    padding: 0.2em 0.6em;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.playlist-list {
    max-height: 60vh;
    overflow-y: auto;
    margin-top: 0;
    margin-bottom: 0;
    text-align: left;
    scrollbar-width: none;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 12px;
    padding: 1em;
}

.playlist-item {
    padding: 1em;
    margin-bottom: 0.5em;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 1.7rem;
    display: flex;
    align-items: center;
    gap: 1em;
    transition: background 0.2s;
    cursor: pointer;
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.2);
}

.playlist-item.inactive {
    background: rgba(255, 255, 255, 0.05);
}

.playlist-item.inactive:hover {
    background: rgba(255, 255, 255, 0.15);
}

.playlist-item:last-of-type {
    margin-bottom: 0em;
}

.playlist-item-icon {
    font-size: 2.2rem;
    color: #aaa;
    flex-shrink: 0;
}

.playlist-item-icon.youtube {
    color: #FF0033;
}

.playlist-item-icon.soundcloud {
    color: #ff5500;
}

.playlist-item-icon.spotify {
    color: #1ED760;
}

.playlist-item-icon.bandcamp {
    color: #629AA9;
}

/* Tidal icon in service icons section */
.service-icons .tidal-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    display: inline-block;
    vertical-align: middle;
}

/* Tidal icon color in playlist items */
.playlist-item-icon.tidal {
    color: #000000; /* Tidal brand color */
    background: linear-gradient(135deg, #00ffff 0%, #0000ff 100%); /* Tidal gradient */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.playlist-item-icon.tidal svg {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.playlist-item-info {
    flex: 1;
    min-width: 0;
}

.playlist-item-title {
    color: #fff;
    font-weight: 500;
    word-break: normal;
    display: block;
}

.playlist-item-meta {
    font-size: 1.5rem;
    color: #888;
    margin-top: 0.1em;
}

.playlist-item-external {
    flex-shrink: 0;
    padding: 0.5em 0.7em;
    margin-left: auto;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.25);
    color: #ddd;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.playlist-item-external:hover {
    background: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.playlist-item.inactive .playlist-item-external {
    opacity: 0.6;
}

.playlist-item.inactive .playlist-item-external:hover {
    opacity: 1;
}

.playlist-item-toggle {
    flex-shrink: 0;
    padding: 0.5em 1em;
    margin-left: calc(5px - 1em);
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.25);
    color: #ddd;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.playlist-item-toggle:hover {
    background: rgba(255, 255, 255, 0.7);
    color: #fff;
}

.playlist-item-toggle.active {
    background: rgba(76, 175, 80, 0.5);
    color: #a5d6a7;
}

.playlist-item-toggle.active:hover {
    background: rgba(76, 175, 80, 0.7);
    color: #c8e6c9;
}

.playlist-item-toggle.inactive {
    background: rgba(244, 67, 54, 0.5);
    color: #ef9a9a;
}

.playlist-item-toggle.inactive:hover {
    background: rgba(244, 67, 54, 0.7);
    color: #ffcdd2;
}

.empty-collection-msg {
    z-index: 10;
    position: relative;
    padding: 2em;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    text-align: center;
    max-width: 600px;
}

.empty-collection-msg h2 {
    font-size: 2.0rem;
    margin-bottom: 1rem;
    color: #333;
}

.empty-collection-msg p {
    font-size: 1.6rem;
    color: #666;
    line-height: 1.5;
}

.empty-collection-msg .add-hint {
    margin-top: 1.5em;
    padding: 1em;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    font-size: 1.4rem;
    color: #555;
}

.empty-collection-msg .kbd {
    display: inline-block;
    padding: 0.2em 0.6em;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
    font-weight: bold;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: 1.15;
    margin: 0;
    padding: 0;
}

iframe,
object,
embed {
    display: block;
    aspect-ratio: 1.77778;
    height: auto;
    width: 100%;
    margin: 0;
    padding: 0;
    background-color: rgba(0, 0, 0, 0.5) !important;
}