/* Minimal waveform canvas styling */
#waveform {
    width: 100%;
    max-width: 680px;
    height: 48px;
    display: block;
    margin: 0 auto 8px auto;
    background: transparent;
    cursor: pointer;
    touch-action: none;
}
@font-face {
    font-family: 'BOAkiraWebV3';
    src: url('assets/fonts/akira-superbold-v2.woff2') format('woff2'),
         url('assets/fonts/akira-superbold-v2.ttf') format('truetype'),
         url('./assets/fonts/akira-superbold-v2.ttf') format('truetype'),
         url('assets/fonts/akira-superbold-v2.otf') format('opentype'),
         url('./assets/fonts/akira-superbold-v2.otf') format('opentype');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'BOAkiraWebV3';
    src: url('assets/fonts/akira-superbold-v2.woff2') format('woff2'),
         url('assets/fonts/akira-superbold-v2.ttf') format('truetype'),
         url('./assets/fonts/akira-superbold-v2.ttf') format('truetype'),
         url('assets/fonts/akira-superbold-v2.otf') format('opentype'),
         url('./assets/fonts/akira-superbold-v2.otf') format('opentype');
    font-style: normal;
    font-weight: 900;
    font-display: swap;
}

html, body {
    height: 100%;
    margin: 0;
    background: #000;
}

*,
*::before,
*::after {
    font-family: 'BOAkiraWebV3' !important;
}

body,
body a,
body button,
body span,
body div,
body input {
    font-family: 'BOAkiraWebV3' !important;
}

body,
body * {
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-synthesis: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.song-title, button#playBtn, #footer {
    font-family: 'BOAkiraWebV3' !important;
    font-weight: 900 !important;
}

.label, .now-playing-label, .song-title, .album-title, .info-row span {
    font-family: 'BOAkiraWebV3' !important;
    font-weight: 900 !important;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    color: #fff;
    overflow: hidden;
    overscroll-behavior-y: contain;
    font-family: 'BOAkiraWebV3' !important;
    padding: env(safe-area-inset-top) 5% env(safe-area-inset-bottom) 5%;
    box-sizing: border-box;
    background: transparent !important;
}

#video-bg, canvas:not(#waveform) {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    object-fit: cover;
    pointer-events: none;
}

#video-bg {
    top: 0;
    left: 0;
    filter: brightness(0.6);
    opacity: 0.5;
    object-fit: cover;
    position: fixed;
}

canvas:not(#waveform) {
    z-index: -1;
}

#nav {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    z-index: 120;
    padding-top: 20px;
}

#nav a {
    color: #ff0000;
    text-decoration: none;
    font-size: 0.92rem;
    letter-spacing: 0;
    text-transform: uppercase;
    padding: 12px 35px;
    width: 210px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    position: relative;
    clip-path: polygon(0% 0%, 85% 0%, 100% 100%, 15% 100%);
    background: #fff;
    transition: 0.3s;
}

#nav .nav-item {
    position: relative;
    display: inline-flex;
    width: 210px;
}

#nav a,
#nav .nav-trigger {
    font-family: 'BOAkiraWebV3' !important;
    font-weight: 400 !important;
    -webkit-text-stroke: 0 !important;
    text-shadow: none !important;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#nav .nav-label {
    display: inline-block;
    font-style: normal;
    transform: none;
    transform-origin: left center;
    line-height: 1;
    pointer-events: none;
}

#nav .nav-trigger {
    color: #ff0000;
    text-decoration: none;
    font-size: 0.92rem;
    letter-spacing: 0;
    text-transform: uppercase;
    padding: 12px 35px;
    width: 210px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    position: relative;
    clip-path: polygon(0% 0%, 85% 0%, 100% 100%, 15% 100%);
    background: #fff;
    transition: 0.3s;
    border: none;
    cursor: pointer;
}

#nav a::after,
#nav .nav-trigger::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 3px;
    right: 3px;
    bottom: 2px;
    background: #000;
    clip-path: polygon(0% 0%, 85% 0%, 100% 100%, 15% 100%);
    z-index: -1;
    transition: 0.3s;
}

#nav a:hover,
#nav .nav-trigger:hover {
    color: #000;
}

#nav a:hover::after,
#nav .nav-trigger:hover::after {
    background: #fff;
}

#links-popup-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    z-index: 300;
    pointer-events: none;
    padding: 16px;
    box-sizing: border-box;
}

#links-popup-overlay.open {
    display: flex;
    pointer-events: auto;
}

#links-popup {
    width: min(900px, 92vw);
    max-height: 72vh;
    background: #000;
    border: 2px solid #fff;
    padding: 28px 26px 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 340;
    pointer-events: auto;
    transform: translateY(-24px);
}

#links-popup,
#links-popup * {
    font-family: 'BOAkiraWebV3' !important;
    font-style: normal !important;
}

#links-popup-close {
    position: absolute;
    top: 8px;
    right: 10px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

#links-popup .popup-logo {
    width: min(430px, 78%);
    height: auto;
}

#links-popup-title {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0.14em;
    color: #fff;
    text-transform: uppercase;
    display: none;
}

.popup-links {
    width: min(520px, 88%);
    overflow-y: auto;
    max-height: 42vh;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 2px;
}

.popup-link {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #111;
    background: #e9e9e9;
    border-radius: 8px;
    border: 1px solid #cfcfcf;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-weight: 900;
    text-transform: uppercase;
}

.popup-link-left {
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.popup-link-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #c7c7c7;
    color: #111;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.66rem;
    letter-spacing: 0;
}

.popup-link-icon-image {
    width: 17px;
    height: 17px;
    display: block;
}

.popup-link-icon-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.popup-link-label {
    white-space: nowrap;
    width: 100%;
    text-align: center;
    font-weight: 900 !important;
}

.popup-link:hover {
    background: #fff;
}

.popup-link .popup-link-arrow {
    color: #666;
    font-size: 1rem;
    line-height: 1;
}

#ui-layer {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    z-index: 20;
}

#logo-image {
    width: 80vw;
    max-width: 700px;
    filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.6));
    border-radius: 10px;
}

.fixed-song-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 30px;
    z-index: 40;
    padding-bottom: 20px;
    transition: transform 0.25s ease;
}

body.popup-open .fixed-song-container {
    transform: translateY(var(--popup-player-offset, 0px));
    justify-content: center;
    position: relative;
    z-index: 310;
}

body.popup-open #album-art {
    display: none;
}

body.popup-open #song-info {
    min-width: min(760px, 92vw);
    max-width: min(760px, 92vw);
    flex: 0 1 auto;
    align-items: center;
}

body.popup-open .scrubber-wrapper {
    width: min(680px, 88vw);
}

body.popup-open .info-row {
    justify-content: center;
    align-items: center;
    text-align: center;
}

#album-art {
    width: 120px;
    height: 120px;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
    transform: none !important;
    transition: none !important;
}

#song-info {
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.info-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 8px;
    width: 100%;
    margin-bottom: 5px;
}

.label {
    font-size: 0.9rem;
    padding-right: 10px;
    white-space: nowrap;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.song-title, .album-title {
    color: #ff0000;
    font-size: 1rem;
    text-transform: uppercase;
    white-space: nowrap;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.scrubber-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.scrubber-container {
    width: 100%;
    height: 10px;
    position: relative;
    border-radius: 3px;
    background: rgba(255, 0, 0, 0.2);
    cursor: pointer;
    overflow: hidden;
    transition: none;
    touch-action: none;
}

.scrubber-container:hover {
    height: 10px;
}

#seek-bar {
    width: 100%;
    cursor: pointer;
    opacity: 0;
    position: absolute;
    z-index: 5;
    height: 32px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    touch-action: none;
}

.scrubber-lines {
    position: absolute;
    top: 2px;
    left: 0;
    width: var(--progress, 0%);
    height: 6px;
    background: linear-gradient(90deg, #ff0000, #ff6b6b);
    border-radius: 3px;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.6);
    transition: width 0.1s linear, height 0.2s ease, top 0.2s ease;
}

.scrubber-container:hover .scrubber-lines {
    top: 1px;
    height: 8px;
}

.scrubber-lines::after {
    content: "";
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #ff0000;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.8);
}

.scrubber-container.dragging {
    height: 10px;
}

.scrubber-container.dragging .scrubber-lines {
    top: 0;
    height: 10px;
    transition: none;
}

.time-display {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 1px;
}

#current-time, #duration-time {
    font-family: 'BOAkiraWebV3' !important;
    font-weight: 900 !important;
}

#controls {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 40px;
    margin-top: 10px;
}

.control-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    transform: none;
    transition: none;
}

.control-btn:hover,
.control-btn:active,
.control-btn:focus {
    transform: none;
}

.pipe {
    width: 4px;
    height: 20px;
    background: #ff0000;
}

.triangle-left {
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 15px solid #ff0000;
}

.triangle-right {
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 15px solid #ff0000;
}

#playIcon {
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-left: 25px solid #ff0000;
}

#playBtn.playing #playIcon {
    width: 25px;
    height: 25px;
    background: #ff0000;
    border: none;
}

#footer {
    width: 100%;
    text-align: center;
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.5);
    padding-bottom: 10px;
}

/* ===== MEDIA QUERIES ===== */

/* 1280px and above - Desktop */
@media (min-width: 1280px) {
    body:not(.popup-open) #waveform {
        height: 120px;
    }

    #nav {
        gap: 30px;
        padding-top: 30px;
    }

    #nav a {
        font-size: 1.02rem;
        padding: 14px 40px;
        width: 240px;
        min-height: 52px;
    }

    #nav .nav-trigger {
        font-size: 1.02rem;
        padding: 14px 40px;
        width: 240px;
        min-height: 52px;
    }

    #nav .nav-item {
        width: 240px;
    }

    #nav .dropdown-menu a {
        font-size: 0.9rem;
        padding: 14px 40px !important;
        min-height: 52px;
    }

    #links-popup {
        transform: translateY(-80px);
    }

    #ui-layer {
        flex: 0.2;
    }

    .fixed-song-container {
        gap: 70px;
        padding-bottom: 50px;
    }

    #album-art {
        width: 320px;
        height: 320px;
    }

    #song-info {
        min-width: 480px;
        max-width: 580px;
        flex: 0 1 580px;
    }

    .label {
        font-size: 1.5rem;
    }

    .song-title, .album-title {
        font-size: 1.5rem;
    }

    .info-row {
        margin-bottom: 10px;
    }

    #controls {
        gap: 50px;
    }

    .scrubber-container {
        height: 12px;
    }

    .scrubber-container:hover {
        height: 12px;
    }

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

    #footer {
        font-size: 0.7rem;
    }
}

/* 768px - Tablet */
@media (max-width: 768px) {
    #nav {
        gap: 15px;
        padding-top: 15px;
    }

    #nav a {
        font-size: 0.95rem;
        padding: 10px 25px;
        width: 210px;
        min-height: 44px;
    }

    #nav .nav-trigger {
        font-size: 0.95rem;
        padding: 10px 25px;
        width: 210px;
        min-height: 44px;
    }

    #nav .nav-item {
        width: 210px;
    }

    #nav a,
    #nav .nav-trigger,
    #nav .nav-label {
        font-weight: 900 !important;
    }

    #nav .dropdown-menu a {
        font-size: 0.86rem;
        padding: 10px 25px !important;
        min-height: 44px;
        font-weight: 900 !important;
    }

    .label,
    .song-title,
    .album-title,
    #current-time,
    #duration-time {
        font-weight: 900 !important;
    }

    .fixed-song-container {
        flex-wrap: nowrap;
        gap: 50px;
        padding-bottom: 30px;
    }

    #song-info {
        min-width: 320px;
    }

    #album-art {
        width: 100px;
        height: 100px;
    }

    #logo-image {
        width: 90vw;
        max-width: 700px;
    }

    #controls {
        gap: 50px;
    }

    .scrubber-container {
        height: 10px;
    }

    .scrubber-container:hover {
        height: 10px;
    }

    .time-display {
        font-size: 0.84rem;
        gap: 10px;
    }

    .label {
        font-size: 1rem;
    }

    .song-title, .album-title {
        font-size: 1.08rem;
    }

    #footer {
        font-size: 0.6rem;
        padding-bottom: 8px;
    }
}

/* 600px - Small Mobile */
@media (max-width: 600px) {
    body {
        padding: env(safe-area-inset-top) 3% env(safe-area-inset-bottom) 3%;
    }

    #nav {
        width: min(100%, 420px);
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        padding-top: 8px;
        align-items: stretch;
    }

    #nav a {
        font-size: 0.8rem;
        letter-spacing: 0;
        padding: 5px 10px;
        width: 100%;
        min-height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        clip-path: polygon(0% 0%, 85% 0%, 100% 100%, 15% 100%);
        border: none;
        background: #ffffff;
        overflow: hidden;
        isolation: isolate;
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }

    #nav .nav-item {
        width: 100%;
    }

    #nav .nav-trigger {
        width: 100%;
        font-size: 0.8rem;
        letter-spacing: 0;
        padding: 5px 10px;
        min-height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        clip-path: polygon(0% 0%, 85% 0%, 100% 100%, 15% 100%);
        border: none;
        background: #ffffff;
        overflow: hidden;
        isolation: isolate;
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }

    #nav a,
    #nav .nav-trigger,
    #nav .nav-label {
        font-weight: 900 !important;
    }

    #nav .dropdown-menu a {
        font-size: 0.72rem;
        letter-spacing: 1px;
        padding: 5px 10px !important;
        min-height: 28px;
        font-weight: 900 !important;
    }

    #links-popup-overlay {
        align-items: center;
        padding: 8px;
    }

    #links-popup {
        width: min(96vw, 560px);
        max-height: 70vh;
        padding: 14px 10px 12px;
        gap: 8px;
        transform: translateY(-40px);
    }

    body.popup-open .fixed-song-container {
        transform: translateY(calc(var(--popup-player-offset, 0px) - 5px));
    }

    #links-popup,
    #links-popup *,
    #links-popup-title,
    .popup-link,
    .popup-link-label,
    .popup-link .popup-link-arrow,
    #links-popup-close {
        font-family: 'BOAkiraWebV3' !important;
        font-style: normal !important;
        font-weight: 900 !important;
    }

    #links-popup .popup-logo {
        width: min(300px, 74%);
    }

    .popup-links {
        width: min(320px, 84%);
        max-height: 46vh;
        gap: 6px;
    }

    .popup-link {
        border-radius: 6px;
        padding: 7px 10px;
        font-size: 0.8rem;
    }

    .popup-link-left {
        grid-template-columns: 22px 1fr;
        gap: 8px;
    }

    .popup-link-icon {
        width: 22px;
        height: 22px;
        flex: 0 0 22px;
    }

    .popup-link-icon-image {
        width: 14px;
        height: 14px;
    }

    .popup-link .popup-link-arrow {
        font-size: 0.82rem;
    }

    .label,
    .song-title,
    .album-title,
    #current-time,
    #duration-time {
        font-weight: 900 !important;
    }

    #nav a::after {
        top: 2px;
        left: 3px;
        right: 3px;
        bottom: 2px;
        clip-path: polygon(0% 0%, 85% 0%, 100% 100%, 15% 100%);
        border-radius: 0;
        background: rgba(0, 0, 0, 1);
    }

    #nav .nav-trigger::after {
        top: 2px;
        left: 3px;
        right: 3px;
        bottom: 2px;
        clip-path: polygon(0% 0%, 85% 0%, 100% 100%, 15% 100%);
        border-radius: 0;
        background: rgba(0, 0, 0, 1);
    }

    #nav .dropdown-menu {
        left: 0;
        right: 0;
        transform: none;
        min-width: 0;
    }

    #ui-layer {
        flex: 0.8;
        padding: 10px 0;
    }

    #logo-image {
        width: 92vw;
        max-width: 420px;
    }

    .fixed-song-container {
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding-bottom: 30px;
    }

    #album-art {
        width: 96px;
        height: 96px;
    }

    #song-info {
        min-width: 0;
        width: min(100%, 420px);
        max-width: min(100%, 420px);
        align-items: center;
    }

    .scrubber-wrapper {
        width: 100%;
        gap: 8px;
        margin-bottom: 10px;
    }

    .scrubber-container {
        height: 10px;
    }

    .scrubber-container:hover {
        height: 10px;
    }

    .time-display {
        font-size: 0.94rem;
    }

    .info-row {
        display: flex;
        flex-wrap: nowrap;
        align-items: baseline;
        justify-content: center;
        gap: 4px;
        width: 100%;
        margin-bottom: 3px;
    }

    .label {
        font-size: 0.82rem;
        padding-right: 2px;
        white-space: nowrap;
    }

    .song-title, .album-title {
        color: #ff0000;
        font-size: 0.82rem;
        text-transform: uppercase;
        white-space: nowrap;
        text-align: left;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: min(55vw, 245px);
    }

    #controls {
        gap: 50px;
    }

    #footer {
        font-size: 0.6rem;
        padding-bottom: 5px;
    }
}