/* ── Visible YouTube Player ───────────────────────────────── */
/* YouTube's policies require the playing player to be visible on the page. js/video.js moves
   #yt-host over the Now Playing art square, or the mini-player square while browsing menus. */

#yt-host {
    position: absolute;
    z-index: 5;
    overflow: hidden;
    background: #000;
    pointer-events: auto;
    transition: left 150ms ease-out, top 150ms ease-out, width 150ms ease-out, height 150ms ease-out;
}

#yt-host[hidden] {
    display: none;
}

/* Jeff's uploads are a square cover centred in a 16:9 frame: show the centre square. */
#yt-host iframe {
    position: absolute;
    top: 0;
    left: -38.889%;
    width: 177.778%;
    height: 100%;
    border: 0;
}

/* Flat art square so the player can sit exactly on it (the 3D tilt can't be matched by an overlay). */
.artwork-container {
    transform: none;
}

/* The upstream layout tucked the text under the tilted art; with a flat square it would overlap. */
.track-info {
    margin-left: 0;
}

/* ── Menu layout: list above, mini-player below ───────────── */

#menu-view {
    display: flex;
    flex-direction: column;
}

#menu-slider {
    flex: 1 1 0;
    min-height: 0;
    height: auto;
}

#mini-player {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: calc(var(--u) * 8);
    height: calc(var(--u) * 40);
    padding: calc(var(--u) * 4) calc(var(--u) * 8);
    background: linear-gradient(to bottom, #f5e6ff 0%, #ebc2ff 100%);
    border-top: calc(var(--u) * 1) solid #c99ff5;
    pointer-events: auto;
    cursor: pointer;
}

#mini-player[hidden] {
    display: none;
}

#mini-player .mini-art {
    flex: 0 0 auto;
    width: calc(var(--u) * 32);
    height: calc(var(--u) * 32);
    background: #000;
}

#mini-player .mini-text {
    min-width: 0;
    flex: 1 1 auto;
    line-height: 1.15;
}

#mini-player .mini-title,
#mini-player .mini-artist {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: calc(var(--u) * -0.3);
}

#mini-player .mini-title {
    font-size: calc(var(--u) * 13);
    font-weight: 700;
    color: #2d1b4e;
}

#mini-player .mini-artist {
    font-size: calc(var(--u) * 11);
    font-weight: 600;
    color: #8b5c96;
}

/* ── Open in YouTube (Now Playing) ────────────────────────── */

.track-info .open-yt {
    pointer-events: auto;
    margin-top: calc(var(--u) * 6);
    font-size: calc(var(--u) * 12);
    font-weight: 700;
    color: #c92880;
    text-decoration: none;
    white-space: nowrap;
}

.track-info .open-yt::before {
    content: "▶ ";
}

.track-info .open-yt:hover {
    text-decoration: underline;
}

/* ── "Continue in YouTube?" hand-off prompt ───────────────── */

#handoff {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(45, 27, 78, 0.45);
    pointer-events: auto;
}

#handoff .handoff-box {
    width: 82%;
    padding: calc(var(--u) * 10) calc(var(--u) * 12);
    border-radius: calc(var(--u) * 8);
    background: linear-gradient(135deg, #faf8ff 0%, #fff5f8 100%);
    box-shadow: 0 calc(var(--u) * 4) calc(var(--u) * 16) rgba(0, 0, 0, 0.35);
    text-align: center;
    color: #2d1b4e;
}

#handoff .handoff-heading {
    font-size: calc(var(--u) * 15);
    font-weight: 700;
}

#handoff .handoff-song,
#handoff .handoff-from {
    font-size: calc(var(--u) * 11);
    font-weight: 600;
    color: #8b5c96;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#handoff .handoff-song {
    margin-top: calc(var(--u) * 4);
}

#handoff .handoff-open,
#handoff .handoff-dismiss {
    display: block;
    width: 100%;
    margin-top: calc(var(--u) * 8);
    padding: calc(var(--u) * 5) 0;
    border: 0;
    border-radius: calc(var(--u) * 6);
    font: inherit;
    font-size: calc(var(--u) * 13);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

#handoff .handoff-open {
    background: linear-gradient(to bottom, #ec48a6 0%, #c92880 100%);
    color: #fff;
}

#handoff .handoff-dismiss {
    margin-top: calc(var(--u) * 4);
    background: transparent;
    color: #8b5c96;
}

/* ── Mini-player transport buttons ────────────────────────── */

#mini-player .mini-controls {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

#mini-player .mini-btn {
    width: calc(var(--u) * 26);
    height: calc(var(--u) * 26);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #2d1b4e;
    font-size: calc(var(--u) * 20);
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

#mini-player .mini-btn[data-action="playpause"] {
    color: #c92880;
    font-size: calc(var(--u) * 24);
}

#mini-player .mini-btn:active {
    background: rgba(201, 40, 128, 0.15);
}

/* ── Photos ───────────────────────────────────────────────── */

.photo-frame {
    position: relative;
    width: 100%;
    height: 100%;
    background: #eee6d4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.photo-frame img {
    position: absolute;    /* sized and placed by layoutPhoto() in ui.js */
    display: block;
    max-width: none;
}

.photo-frame .photo-count {
    position: absolute;
    right: calc(var(--u) * 6);
    bottom: calc(var(--u) * 4);
    padding: calc(var(--u) * 1) calc(var(--u) * 6);
    border-radius: calc(var(--u) * 8);
    background: rgba(45, 27, 78, 0.55);
    color: #fff;
    font-size: calc(var(--u) * 10);
    font-weight: 600;
}

/* ── Brick ────────────────────────────────────────────────── */

.brick-canvas {
    display: block;
}
