
@font-face {
    font-family: 'Mesgentia';
    src: url('../assets/fonts/Mesgentia.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    ascent-override: 100%;
    descent-override: 20%;
    line-gap-override: 0%;
}

@font-face {
    font-family: 'Mineko';
    src: url('../assets/fonts/Mineko.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    ascent-override: 97.5%;
    descent-override: 22.5%;
    line-gap-override: 0%;
}

@font-face {
    font-family: 'Minecraft';
    src: url('../assets/fonts/MinecraftRegular-Bmg3.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Minecraft';
    src: url('../assets/fonts/MinecraftBold-nMK1.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}
@font-face {
    font-family: 'Minecraft';
    src: url('../assets/fonts/MinecraftItalic-R8Mo.otf') format('opentype');
    font-weight: normal;
    font-style: italic;
}
@font-face {
    font-family: 'Minecraft';
    src: url('../assets/fonts/MinecraftBoldItalic-1y1e.otf') format('opentype');
    font-weight: bold;
    font-style: italic;
}

@font-face {
    font-family: 'Imprima';
    src: url('/assets/fonts/Imprima-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Lora';
    src: url('/assets/fonts/Lora-Regular.ttf?v=2') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Lora';
    src: url('/assets/fonts/Lora-Bold.ttf?v=2') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Lora';
    src: url('/assets/fonts/Lora-Italic.ttf?v=2') format('truetype');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'Lora';
    src: url('/assets/fonts/Lora-BoldItalic.ttf?v=2') format('truetype');
    font-weight: bold;
    font-style: italic;
}

:root {
    --player-bg: #FDF8F4;
    --border-color: #B8878C;
    --btn-color: #B8878C;
    --text-color: #555555;
    --scale: 1;
    --font-family: 'Minecraft', monospace;
    --primary-lighter: color-mix(in srgb, var(--border-color) 15%, transparent);
    
    
    --modal-bg: #ffffff;
    --modal-text: #333333;
    --modal-text-muted: #777777;
    --modal-border: #deb8b8;
    --modal-input-bg: #f9f6f6;
}


:root[data-theme="dark"] {
    --modal-bg: #1e1e1e;
    --modal-text: #e3e3e2;
    --modal-text-muted: #9b9a97;
    --modal-border: #444444;
    --modal-input-bg: #292929;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --modal-bg: #1e1e1e;
        --modal-text: #e3e3e2;
        --modal-text-muted: #9b9a97;
        --modal-border: #444444;
        --modal-input-bg: #292929;
    }
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: transparent !important;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 10px 10px;
}


html {
    background: transparent !important;
    overflow: hidden;
}
html, body {
    user-select: none;
    -webkit-user-select: none;
}


.player-wrap {
    position: relative;
    width: 100%;
    max-width: 450px;
}

.pill-player {
    position: relative;
    width: 100%;
    max-width: 450px;
    height: 52px;
    --ring: 1.5px;
    background-color: var(--player-bg);
    box-shadow: inset 0 0 0 var(--ring) var(--border-color);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 calc(16px + var(--ring));
    gap: 12px;
    overflow: hidden;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}


.progress-bar-container {
    position: absolute;
    bottom: var(--ring);
    left: calc(24px + var(--ring));
    right: calc(24px + var(--ring));
    height: 3px;
    background: transparent;
    overflow: hidden;
    cursor: pointer;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--border-color);
    opacity: 0.7;
    transition: width 0.1s linear;
}


.player-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.player-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--btn-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform 0.1s ease, opacity 0.2s ease, background-color 0.2s ease;
    padding: 3px;
}

.player-btn svg {
    width: 100%;
    height: 100%;
    display: block;
}

.player-btn:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.player-btn:active {
    transform: scale(0.9);
}

.play-btn {
    width: 32px;
    height: 32px;
    padding: 4px;
}


.settings-btn svg {
    transition: transform 0.3s ease;
}

.settings-btn:hover svg {
    transform: rotate(45deg);
}


.tracklist-toggle svg {
    transition: transform 0.28s ease;
}

.tracklist-toggle.open svg {
    transform: rotate(180deg);
}


.tracklist-dropdown {
    width: 100%;
    background-color: var(--player-bg);
    box-shadow: inset 0 0 0 0 var(--border-color);
    border-radius: 22px;
    overflow: hidden;
    max-height: 0;
    margin-top: 0;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.3s ease, opacity 0.22s ease, margin-top 0.3s ease, box-shadow 0.3s ease;
}

.tracklist-dropdown.open {
    max-height: 230px;
    margin-top: 6px;
    box-shadow: inset 0 0 0 1.5px var(--border-color);
    opacity: 1;
    pointer-events: auto;
}

.tracklist-inner {
    max-height: 230px;
    overflow-y: auto;
    margin: 1.5px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tracklist-inner::-webkit-scrollbar {
    width: 4px;
    background: transparent;
}

.tracklist-inner::-webkit-scrollbar-track {
    background: transparent !important;
}

.tracklist-inner::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 99px;
}


.track-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border-radius: 9999px;
    cursor: pointer;
    overflow: hidden;
    transition: background-color 0.15s ease;
}

.track-row:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.track-row.active {
    background-color: var(--btn-color);
}

.track-row .row-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    color: var(--btn-color);
}

.track-row.active .row-icon {
    color: var(--player-bg);
}

.track-row .row-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    overflow: hidden;
}

.track-row .row-title {
    font-size: 12px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-row .row-artist {
    font-size: 10px;
    color: var(--text-color);
    opacity: 0.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-row.active .row-title,
.track-row.active .row-artist {
    color: var(--player-bg);
    opacity: 1;
}

.track-row.active .row-artist {
    opacity: 0.8;
}


.tracklist-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.tracklist-bars span {
    flex: 1;
    background-color: var(--player-bg);
    border-radius: 2px;
    height: 30%;
    animation: eq-bounce 0.9s ease-in-out infinite;
}

.tracklist-bars span:nth-child(2) {
    animation-delay: 0.3s;
}

.tracklist-bars span:nth-child(3) {
    animation-delay: 0.15s;
}

@keyframes eq-bounce {
    0%, 100% { height: 30%; }
    50% { height: 100%; }
}


.tracklist-empty {
    padding: 16px 12px;
    text-align: center;
    font-size: 11px;
    color: var(--text-color);
    opacity: 0.6;
}


.marquee-section {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 24px;
    padding: 0 8px;
    border-left: 1px dotted var(--border-color);
    border-right: 1px dotted var(--border-color);
    overflow: hidden;
}

.note-icon {
    width: 13px;
    height: 13px;
    color: var(--btn-color);
    flex-shrink: 0;
}

.marquee-container {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

.song-marquee {
    font-size: 13px;
    color: var(--text-color);
    white-space: nowrap;
    text-overflow: clip;
    display: inline-block;
}


.song-marquee.scrolling {
    animation: marquee-scroll 10s linear infinite;
    padding-right: 50px; 
}

@keyframes marquee-scroll {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}


.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent;
    z-index: 1000;
    display: none;
}

.settings-overlay.active {
    display: block;
}


.settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    max-height: 85vh;
    background: var(--modal-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    display: none;
    z-index: 1001;
    box-shadow: none;
    overflow: hidden;
}

.settings-panel.active {
    display: block;
}

.settings-panel .window-style-btn.active {
    color: var(--on-border, #FFFFFF);
}

.settings-content {
    padding: 12px;
    max-height: 85vh;
    overflow-y: auto;
}

.settings-content::-webkit-scrollbar {
    width: 4px;
    background: transparent;
}

.settings-content::-webkit-scrollbar-track {
    background: transparent !important;
}

.settings-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--primary-lighter);
}

.settings-header h3 {
    font-size: 10px;
    font-weight: 600;
    color: var(--modal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-close {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--modal-text-muted);
    border-radius: 50%;
    transition: background-color 0.2s;
}

.settings-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--modal-text);
}


.settings-section {
    margin-bottom: 12px;
}

.settings-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--modal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: block;
    margin-bottom: 6px;
}


.colors-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.color-sublabel {
    font-size: 9px;
    color: var(--modal-text-muted);
}

.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-input-wrapper input[type="color"] {
    width: 18px;
    height: 18px;
    border: 1px solid var(--primary-lighter);
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    background: none;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

.color-hex {
    width: 62px;
    height: 18px;
    flex: none;
    font-size: 10px;
    font-family: inherit;
    font-weight: 400;
    color: var(--modal-text);
    background: var(--primary-lighter);
    border: none;
    border-radius: 999px;
    padding: 3px 6px;
    text-align: center;
    text-transform: uppercase;
    outline: none;
}


.y2k-select {
    font-family: inherit;
    width: 100%;
    font-size: 10px;
    color: var(--modal-text);
    background: var(--primary-lighter);
    border: none;
    border-radius: 9999px;
    padding: 6px 26px 6px 10px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 1 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}


.setting-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.setting-toggle-row .settings-label {
    margin-bottom: 0;
}

.cute-toggle {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    flex-shrink: 0;
}

.cute-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--primary-lighter);
    transition: .2s ease;
    border-radius: 999px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: #FFFFFF;
    transition: .2s ease;
    border-radius: 50%;
}

.cute-toggle input:checked + .toggle-slider {
    background-color: var(--border-color);
}

.cute-toggle input:checked + .toggle-slider:before {
    transform: translateX(14px);
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.size-slider {
    flex: 1;
    min-width: 0; /* webkit won't shrink a range below 129px, guards a narrow embed */
    height: 3px;
    background: var(--primary-lighter);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    cursor: pointer;
}

.slider-value {
    font-size: 10px;
    font-family: inherit;
    color: var(--modal-text);
    min-width: 32px;
    text-align: right;
}


.track-slots-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Add Song: koucal's Add Category pill, full width under the songs (nari, 10/03: 5 songs by default, a button for more) */
.add-slot-btn {
    width: 100%;
    height: 24px;
    margin-top: 10px;
    padding: 0 8px;
    border: none;
    border-radius: 999px;
    font-size: 10px;
    font-family: inherit;
    background: var(--primary-lighter);
    color: var(--modal-text);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.add-slot-btn:hover {
    background: color-mix(in srgb, var(--border-color) 30%, transparent);
}

.track-slot {
    background: var(--primary-lighter);
    border: none;
    border-radius: 16px;
    padding: 10px;
}

/* the Song label sits with even space around it (nari, 10/03): its capitals start 10px from the top like the
   sides, and its baseline sits 10px above the upload button. the row is exactly one cap tall and the label is
   trimmed to cap + baseline, so this holds in every widget font (Delete centers on the same row). */
.track-slot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 9px;
    height: 1cap;
}

.slot-number {
    font-size: 9px;
    font-weight: 700;
    color: var(--modal-text-muted);
    text-box: trim-both cap alphabetic;
}

.track-delete-btn {
    font-family: inherit;
    border: none;
    background: transparent;
    color: var(--border-color);
    cursor: pointer;
    font-size: 9px;
    display: flex;
    align-items: center;
    gap: 2px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.track-delete-btn:hover {
    opacity: 1;
}


.slot-inputs {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.slot-input {
    width: 100%;
    font-size: 10px;
    color: var(--modal-text);
    background: var(--modal-bg);
    border: none;
    border-radius: 9999px;
    padding: 5px 12px;
    outline: none;
}


.upload-btn-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--modal-bg);
    border: none;
    border-radius: 9999px;
    padding: 10px 18px;
    font-size: 10px;
    color: var(--modal-text-muted);
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s, border-color 0.2s;
}

.upload-btn-label:hover {
    background-color: var(--modal-input-bg);
    color: var(--modal-text);
}

.upload-btn-label svg {
    width: 12px;
    height: 12px;
}

.file-input {
    display: none;
}

.slot-upload-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
}

.or-separator {
    font-size: 8px;
    color: var(--modal-text-muted);
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.5px;
    margin: 2px 0;
}

.slot-url-paste {
    width: 100%;
    font-size: 10px;
    color: var(--modal-text);
    background: var(--modal-bg);
    border: none;
    border-radius: 9999px;
    padding: 6px 12px;
    outline: none;
    text-align: center;
}

.slot-url-field {
    font-family: 'Inter', monospace;
    font-size: 9px;
    opacity: 0.8;
}

.y2k-btn {
    font-family: inherit;
    width: 100%;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--on-border, var(--modal-bg));
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 8px 16px;
    outline: none;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s, transform 0.1s ease;
}

.y2k-btn:hover {
    background: var(--btn-color);
    opacity: 0.9;
}

.y2k-btn:active {
    transform: scale(0.98);
}

.settings-help {
    font-size: 8px;
    color: var(--modal-text-muted);
    margin-bottom: 8px;
    line-height: 1.3;
}

[data-shape="square"] .pill-player {
    border-radius: 0;
    --ring: 2px;
}

[data-shape="square"] .progress-bar-container,
[data-shape="square"] .progress-bar,
[data-shape="square"] .player-btn,
[data-shape="square"] .play-btn,
[data-shape="square"] .settings-btn,
[data-shape="square"] .tracklist-toggle,
[data-shape="square"] .tracklist-dropdown,
[data-shape="square"] .tracklist-inner,
[data-shape="square"] .track-row,
[data-shape="square"] .track-row .row-icon,
[data-shape="square"] .y2k-select,
[data-shape="square"] .settings-panel,
[data-shape="square"] .settings-content,
[data-shape="square"] .settings-close,
[data-shape="square"] input,
[data-shape="square"] select,
[data-shape="square"] textarea,
[data-shape="square"] button {
    border-radius: 0;
}

[data-shape="square"] .track-slot,
[data-shape="square"] .slot-input,
[data-shape="square"] .upload-btn-label,
[data-shape="square"] .slot-url-paste,
[data-shape="square"] .track-row,
[data-shape="square"] .tracklist-dropdown {
    border-radius: 0;
}

.embed-link-manual {
    width: 100%;
    margin-top: 6px;
    font-size: 9px;
    color: var(--text-color, #555);
    background: var(--modal-bg);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 6px 10px;
    outline: none;
    box-sizing: border-box;
}

#embed-link-status {
    display: block;
    margin-top: 6px;
}

[data-shape="square"] .embed-link-manual {
    border-radius: 0;
}

[data-shape="square"] .tracklist-bars span {
    border-radius: 0;
}

/* the title stays put while the settings scroll, like kourie's. it sits outside
   the scroller now, in the same spot as before, and the scroller keeps its 4px
   gutter so the line under the title ends where the rows do. nari 2026-10-02. */
.settings-panel.active {
    display: flex;
    flex-direction: column;
}

.settings-panel > .settings-header {
    flex-shrink: 0;
    margin: 12px 16px 0 12px;
}

.settings-panel > .settings-content {
    min-height: 0;
    scrollbar-gutter: stable;
}

/* the pill words (Curve / Square, Outline / Filled): the line is trimmed to the letters, then
   lifted so the middle point between the capital tops and the lowercase tops sits at the middle
   of the pill. it reads each font's own cap and x-heights, so it fits every widget font; same 25px
   pill. browsers without text-box or the cap unit keep a centered line. nari, 10/02 */
.settings-panel .window-style-btn {
    text-box: trim-both cap alphabetic;
    height: 25px;
    padding-top: 0;
    padding-bottom: 0;
    padding-bottom: calc((1cap - 1ex) / 2);
}

/* Imprima sits a hair high with the rule above, so it comes down a quarter pixel (nari's pick) */
@container style(--font-family: 'Imprima', sans-serif) {
    .settings-panel .window-style-btn {
        padding-bottom: calc((1cap - 1ex) / 2 - 0.5px);
    }
}
