/* Real library rows: title, artist and playlist operations. */
body #musicPlayerScreen .music-wrap{display:flex;flex-direction:column;gap:10px;min-height:0}
body #musicPlayerScreen .music-secondary-actions{display:flex;gap:8px;flex-wrap:wrap}
body #musicPlayerScreen :is(#musicLyricsOpen,#musicListOpen,#musicBackgroundOpen,#musicShopOpen){flex:1;min-width:85px;min-height:44px;border-radius:999px;padding:8px 12px;font:700 14px/1.2 system-ui}
body #musicStatus{font:12px/1.5 system-ui;overflow-wrap:anywhere;margin:0;color:inherit;min-height:18px}
body #musicStatus[data-error="true"]{color:#9b2537}
body #musicListDialog{width:min(94vw,760px);height:min(88dvh,780px);max-height:calc(100dvh - 20px);padding:14px;gap:12px;background:#f7f9fced;color:#213447;border:1px solid #d6dfe8;border-radius:20px}
body #musicListDialog[open]{display:flex;flex-direction:column}
body #musicListDialog .music-list{display:flex;flex-direction:column;overflow:auto;touch-action:pan-y;scroll-snap-type:none;grid-template-rows:none;grid-auto-flow:unset;grid-auto-columns:unset;gap:8px;flex:1;min-height:0;height:auto}
body #musicListDialog .music-track-row{display:flex;flex-direction:row;align-items:center;gap:4px;flex:none;height:64px;min-height:64px;overflow:hidden;border:1px solid #d6dfe8;border-radius:12px;background:#fff}
body #musicListDialog .music-track{display:block;flex:1 1 0;min-height:62px;height:62px;padding:8px 10px;border:0;min-width:0;overflow:hidden;background:transparent;color:#213447;text-align:left}
body #musicListDialog .music-track>span{display:block;min-width:0;overflow:hidden}
body #musicListDialog .music-track[aria-pressed="true"]{box-shadow:inset 3px 0 #467da7}
body #musicListDialog .music-track b{display:block;font:700 15px/1.45 system-ui;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}
body #musicListDialog .music-track small{display:block;font:12px/1.45 system-ui;margin-top:2px;color:#536575;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}
body #musicListDialog .music-track-actions{display:flex;align-items:center;gap:4px;flex:0 1 auto;min-width:88px;max-width:52%;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;padding:4px 6px;scrollbar-width:thin}
body #musicListDialog .music-track-actions button{flex:none;white-space:nowrap;min-width:44px;min-height:44px;width:auto;height:44px;border:1px solid #d6dfe8;border-radius:8px;padding:5px 10px;background:#f0f4f8;color:#213447;font:12px/1.4 system-ui}
body #musicListDialog .music-track-favorite{align-self:auto;font-size:18px!important;min-width:44px}
body .music-library-tools{display:flex;flex-direction:column;gap:8px;flex:none;min-height:0}
body .music-library-row{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
body .music-library-tools :is(button,select,input){min-height:40px;box-sizing:border-box;font:13px/1.3 system-ui;border:1px solid #bfcbd6;border-radius:8px;padding:7px 9px;max-width:100%;color:#213447;background:#fff}
body .music-library-tools select{flex:1;min-width:140px}
body .music-library-tools label{font:12px/1.4 system-ui;color:#405565}
body #musicPlaylistName{flex:1;min-width:120px;width:140px}
body .music-empty{margin:16px 8px;font:14px/1.6 system-ui;color:#536575}
body .music-track-editor{display:flex;flex:none;gap:8px;padding:10px;flex-wrap:wrap;border:1px solid #d6dfe8;border-radius:12px;background:#fff}
body .music-track-editor label{flex:1;min-width:125px;font:12px/1.4 system-ui}
body .music-track-editor input{display:block;box-sizing:border-box;width:100%;min-height:40px;padding:6px 8px;font:14px/1.4 system-ui;border:1px solid #bfcbd6;border-radius:6px}
body .music-track-editor button{min-height:40px;padding:7px 10px;border-radius:6px;border:1px solid #bfcbd6;color:#213447;background:#eef3f8}
body #musicShopDialog{box-sizing:border-box;width:min(94vw,720px);max-height:86dvh;border:1px solid #d6dfe8;border-radius:18px;background:#f7f9fc;color:#213447;padding:14px;overflow:auto}
body #musicShopDialog:not([open]){display:none}
body #musicShopDialog>header{display:flex;justify-content:space-between;align-items:center;gap:8px}
body #musicShopDialog h2{font:700 20px/1.4 system-ui;margin:0}
body #musicShopClose{min-width:44px;min-height:44px;border:1px solid #bfcbd6;border-radius:50%;background:#fff;color:#213447;font:22px/1 system-ui}
body #musicShopList{display:flex;flex-direction:column;gap:8px;margin-top:12px}
body .music-shop-row{display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid #d6dfe8;padding:10px 0}
body .music-shop-row>span{min-width:0;flex:1;overflow:hidden}
body .music-shop-row b{display:block;font:700 14px/1.5 system-ui;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body .music-shop-row small{display:block;font:12px/1.5 system-ui;color:#536575;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body .music-shop-row button{flex:none;font:12px/1.4 system-ui;min-height:44px;max-width:130px;padding:7px 10px;border:1px solid #bfcbd6;border-radius:8px;background:#fff;color:#213447}
body #musicShopDialog::backdrop{background:#10213960;backdrop-filter:blur(3px)}
body .music-library-tools button:disabled,body .music-track-actions button:disabled{opacity:.5}
@media(max-width:430px){body #musicListDialog{padding:10px;gap:8px}body .music-library-tools :is(button,select,input){font-size:12px;padding:6px 7px}body .music-library-row{gap:4px}body #musicPlaylistName{width:100%;flex-basis:100%}body .music-track-actions button{padding:5px 8px}}
/* The independent project shares the same module and control IDs. */
body.music-standalone{margin:0;min-height:100dvh;background:#edf1f6;color:#213447;font-family:system-ui,-apple-system,sans-serif}
body.music-standalone *{box-sizing:border-box}
body.music-standalone #musicPlayerScreen{--music-content-bottom:max(22px,env(safe-area-inset-bottom));min-height:100dvh;max-width:720px;margin:auto;padding:calc(var(--nm-gameplay-top,66px) + 22px) max(18px,env(safe-area-inset-right)) var(--music-content-bottom) max(18px,env(safe-area-inset-left));overflow:auto}
body.music-standalone #musicPlayerScreen::before{content:none}
body.music-standalone .music-wrap{min-height:calc(100dvh - var(--nm-gameplay-top,66px) - 22px - var(--music-content-bottom));justify-content:center}
body.music-standalone .music-project-header{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:auto}
body.music-standalone .music-heading{margin:0 0 auto;font:700 22px/1.4 system-ui;letter-spacing:.04em}
body.music-standalone .music-project-wallet{display:flex;align-items:center;gap:6px;font:12px/1.4 system-ui}
body.music-standalone #musicCoinValue{font-weight:700;font-variant-numeric:tabular-nums}
body.music-standalone #musicCoinRetry{min-height:36px;border:1px solid #c5d1dc;border-radius:7px;background:#fff;color:#213447;font:12px/1.3 system-ui;padding:5px 8px}
body.music-standalone .music-now-playing{padding:22px 0;text-align:center}
body.music-standalone .music-title{font:700 clamp(20px,6vw,30px)/1.4 system-ui;overflow-wrap:anywhere}
body.music-standalone .music-credit{font:14px/1.6 system-ui;color:#536575;margin-top:6px}
body.music-standalone .music-progress{width:100%;min-height:40px;accent-color:#467da7}
body.music-standalone .music-times{display:flex;justify-content:space-between;font:12px/1.4 system-ui}
body.music-standalone .music-controls{display:flex;justify-content:center;align-items:center;gap:20px;margin:14px 0}
body.music-standalone button{cursor:pointer}
body.music-standalone .music-controls button{width:56px;height:56px;border:1px solid #c5d1dc;border-radius:50%;background:#fff;color:#213447;font:26px/1 system-ui}
body.music-standalone .music-controls #musicToggle{width:72px;height:72px;background:#345e80;color:#fff;border:0}
body.music-standalone .music-options{display:flex;justify-content:center;gap:8px;flex-wrap:wrap}
body.music-standalone .music-options button{border:1px solid #c5d1dc;border-radius:8px;background:#fff;color:#213447;font:12px/1.4 system-ui;padding:8px 12px;min-height:40px}
body.music-standalone .music-secondary-actions{margin:12px 0 6px}
body.music-standalone .music-secondary-actions button{border:1px solid #c5d1dc;background:#fff;color:#213447}
body.music-standalone #musicStatus{margin-bottom:auto}
body.music-standalone #musicListDialog:not([open]),body.music-standalone #musicLyricsDialog:not([open]){display:none}
body.music-standalone #musicListDialog>header{display:flex;justify-content:space-between;align-items:center}
body.music-standalone #musicListDialog h2{margin:0;font:700 20px/1.4 system-ui}
body.music-standalone #musicListClose{min-width:44px;min-height:44px;border:1px solid #c5d1dc;border-radius:50%;background:#fff;color:#213447;font:22px/1 system-ui}
body.music-standalone #musicListDialog::backdrop,body.music-standalone #musicLyricsDialog::backdrop{background:#10213960}
body.music-standalone #musicLyricsDialog{width:min(94vw,720px);max-height:88dvh;padding:16px;border:1px solid #d6dfe8;border-radius:18px;color:#213447;background:#f7f9fc}
body.music-standalone .music-lyrics-header{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
body.music-standalone .music-lyrics-header h2{margin:0;font:700 20px/1.4 system-ui}
body.music-standalone .music-lyrics-header p{font:13px/1.5 system-ui;margin:4px 0 0}
body.music-standalone #musicLyricsClose{min-width:44px;min-height:44px;border:1px solid #c5d1dc;border-radius:50%;background:#fff;color:#213447;font:22px/1 system-ui}
body.music-standalone #musicLyricsText{white-space:pre-wrap;overflow:auto;font:14px/1.8 system-ui;max-height:60dvh}
body.music-standalone #musicPurchaseConfirm{width:min(92vw,460px);border:1px solid #c5d1dc;border-radius:16px;padding:20px;color:#213447;background:#f7f9fc}
body.music-standalone #musicPurchaseConfirm:not([open]){display:none}
body.music-standalone #musicPurchaseConfirm h2{font:700 18px/1.5 system-ui;margin:0;overflow-wrap:anywhere}
body.music-standalone #musicPurchaseConfirm p{font:14px/1.5 system-ui}
body.music-standalone #musicPurchaseConfirm>div{display:flex;gap:8px;justify-content:flex-end}
body.music-standalone #musicPurchaseConfirm button{min-height:44px;padding:8px 14px;border:1px solid #c5d1dc;border-radius:8px;background:#fff;color:#213447;font:14px/1.3 system-ui}
body.music-standalone #musicPurchaseConfirm::backdrop{background:#10213960}
/* Only this decorative layer has 50% opacity; controls and text remain separate. */
body.music-standalone #musicPlayerScreen{isolation:isolate}
body.music-standalone .music-background-layer{position:fixed;inset:0;z-index:-1;pointer-events:none;opacity:.5}
body.music-standalone .music-background-layer:not([data-theme]){display:none}
.music-background-dialog,.music-background-confirm{box-sizing:border-box;width:min(94vw,640px);max-height:86dvh;overflow:auto;padding:16px;border:1px solid #d6dfe8;border-radius:20px;background:#f7f9fc;color:#213447;font-family:system-ui,sans-serif}
.music-background-dialog:not([open]),.music-background-confirm:not([open]){display:none}
.music-background-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:12px}
.music-background-dialog h2,.music-background-confirm h2{font:700 20px/1.4 system-ui;margin:0}
#musicBackgroundClose{--nm-choice-size:44px;flex:none}
#musicBackgroundTabs{display:flex;gap:6px;margin:14px 0;overflow-x:auto;white-space:nowrap;scrollbar-width:thin}
#musicBackgroundTabs button{flex:none;min-height:44px;padding:8px 12px;border:1px solid #c5d1dc;border-radius:9px;background:#fff;color:#213447;font:700 13px/1.3 system-ui}
#musicBackgroundTabs button[aria-selected="true"]{border:2px solid #345e80;background:#e4edf5}
.music-background-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.music-theme-preview{display:block;box-sizing:border-box;width:100%;aspect-ratio:1;border:1px solid #bac9d6;border-radius:0;padding:0;min-width:0;box-shadow:none}
button.music-theme-preview[aria-pressed="true"]{outline:3px solid #345e80;outline-offset:-4px}
button.music-theme-preview:focus-visible,#musicBackgroundTabs button:focus-visible{outline:3px solid #345e80;outline-offset:2px}
#musicBackgroundPanel>p{margin:28px 8px;text-align:center;font:14px/1.6 system-ui}
#musicBackgroundStatus,#musicBackgroundConfirmStatus{font:13px/1.5 system-ui;color:#9b2537;overflow-wrap:anywhere}
#musicBackgroundStatus:empty,#musicBackgroundConfirmStatus:empty{display:none}
.music-background-confirm{width:min(90vw,360px);text-align:center}
#musicBackgroundConfirmPreview{width:120px;margin:18px auto}
.music-background-confirm .nanamono-choice-pair{display:flex;justify-content:center;gap:30px;margin-top:18px}
.music-background-dialog::backdrop,.music-background-confirm::backdrop{background:#10213960}
:is(.music-theme-preview,.music-background-layer)[data-theme="simple-1"]{background:#dce3e9}
:is(.music-theme-preview,.music-background-layer)[data-theme="simple-2"]{background:linear-gradient(145deg,#c7dae8,#e6edf2)}
:is(.music-theme-preview,.music-background-layer)[data-theme="simple-3"]{background:linear-gradient(145deg,#d0dfd8,#edf0e4)}
:is(.music-theme-preview,.music-background-layer)[data-theme^="bubble-"]{background-image:radial-gradient(circle at 24% 28%,#ffffffb3 0 10%,transparent 10.7%),radial-gradient(circle at 76% 68%,#ffffff99 0 17%,transparent 17.7%),radial-gradient(circle at 82% 20%,#ffffff80 0 8%,transparent 8.7%);background-size:220px 300px}
:is(.music-theme-preview,.music-background-layer)[data-theme="bubble-1"]{background-color:#d6e4ed}
:is(.music-theme-preview,.music-background-layer)[data-theme="bubble-2"]{background-color:#dfdde9}
:is(.music-theme-preview,.music-background-layer)[data-theme="bubble-3"]{background-color:#dbe5de}
:is(.music-theme-preview,.music-background-layer)[data-theme^="star-"]{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cpath d='M28 10 32 23 46 23 35 31 39 44 28 36 17 44 21 31 10 23 24 23Z' fill='%23ffffff' fill-opacity='.7'/%3E%3C/svg%3E");background-size:56px 56px}
:is(.music-theme-preview,.music-background-layer)[data-theme="star-1"]{background-color:#d3deea}
:is(.music-theme-preview,.music-background-layer)[data-theme="star-2"]{background-color:#e2dce8}
:is(.music-theme-preview,.music-background-layer)[data-theme="star-3"]{background-color:#e6e0cf}
:is(.music-theme-preview,.music-background-layer)[data-theme^="dot-"]{background-image:radial-gradient(circle,#ffffffd9 2px,transparent 3px);background-size:24px 24px}
:is(.music-theme-preview,.music-background-layer)[data-theme="dot-1"]{background-color:#cfdce7}
:is(.music-theme-preview,.music-background-layer)[data-theme="dot-2"]{background-color:#e6d9dc}
:is(.music-theme-preview,.music-background-layer)[data-theme="dot-3"]{background-color:#d7e2d8}
.music-theme-preview[data-theme^="bubble-"]{background-size:100% 100%}
