:root {
    color-scheme: dark;
    --bg: #07050a;
    --bg-2: #0c0710;
    --panel: rgba(20, 12, 26, .86);
    --panel-2: rgba(27, 13, 31, .92);
    --line: rgba(218, 177, 255, .14);
    --line-strong: rgba(218, 177, 255, .28);
    --text: #f7f0fa;
    --muted: #9f93a6;
    --soft: #c9bdd0;
    --purple: #9a4ce0;
    --purple-2: #c56aff;
    --cherry: #7b123c;
    --cherry-2: #aa2459;
    --good: #7cd6aa;
    --danger: #ff729b;
    --shadow: 0 28px 80px rgba(0, 0, 0, .42);
    --radius: 24px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; font-family: var(--font); color: var(--text); background: linear-gradient(145deg, #050307 0%, #0b0610 48%, #08040a 100%); }
button, input, select { font: inherit; }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.background-mesh { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.background-mesh i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .16; }
.background-mesh i:nth-child(1) { width: 42vw; height: 42vw; left: -14vw; top: -14vw; background: #8d35d0; }
.background-mesh i:nth-child(2) { width: 34vw; height: 34vw; right: -8vw; top: 24vh; background: #8f123f; }
.background-mesh i:nth-child(3) { width: 28vw; height: 28vw; left: 42vw; bottom: -13vw; background: #5c1a78; }

.app-shell { position: relative; z-index: 1; width: min(1560px, calc(100% - 28px)); margin: 0 auto; padding: 18px 0 26px; }
.topbar { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 4px 16px; }
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 16px; display: grid; place-items: center; font-weight: 900; letter-spacing: -.06em; font-size: 1.2rem; color: white; border: 1px solid rgba(227, 189, 255, .24); background: linear-gradient(145deg, rgba(151, 67, 209, .88), rgba(111, 16, 61, .88)); box-shadow: inset 0 1px rgba(255,255,255,.12), 0 12px 30px rgba(81, 18, 112, .28); }
.brand-mark.large { width: 58px; height: 58px; border-radius: 20px; font-size: 1.4rem; }
.brand-text { min-width: 0; }
.brand-text h1 { margin: 0; font-size: 1.08rem; line-height: 1.15; letter-spacing: -.025em; }
.brand-text p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.top-actions, .account-actions { display: flex; align-items: center; gap: 9px; }
.text-button, .soft-link { border: 1px solid var(--line); background: rgba(255,255,255,.035); color: var(--soft); border-radius: 12px; padding: 9px 12px; font-size: .78rem; cursor: pointer; }
.text-button:hover, .soft-link:hover { border-color: var(--line-strong); color: white; background: rgba(154,76,224,.10); }
.icon-button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.035); color: var(--soft); display: inline-grid; place-items: center; cursor: pointer; }
.icon-button:hover { border-color: var(--line-strong); color: white; }
.account-chip { display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.025); }
.account-avatar { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(145deg, rgba(158,73,219,.75), rgba(126,16,60,.76)); color: #fff; font-weight: 900; }
.account-avatar.small { width: 34px; height: 34px; border-radius: 11px; font-size: .82rem; }
.account-copy { display: grid; gap: 1px; }
.account-copy strong { font-size: .76rem; }
.account-copy small { color: var(--muted); font-size: .65rem; }
.account-logout { font-weight: 900; }
.mobile-only { display: none; }

.v5-main { display: grid; grid-template-columns: minmax(390px, .88fr) minmax(560px, 1.35fr); gap: 18px; align-items: stretch; min-height: calc(100vh - 112px); }
.player-panel, .playlist-panel { min-width: 0; }
.player-panel { display: flex; flex-direction: column; gap: 12px; }
.welcome-strip { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 35px; padding: 0 4px; color: var(--muted); font-size: .74rem; }
.welcome-strip span { color: #c99ae8; font-weight: 800; }
.welcome-strip strong { font-size: .72rem; font-weight: 650; color: var(--soft); }
.quote-zone { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quote-card { min-width: 0; min-height: 86px; padding: 13px 15px; border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(35,20,43,.68), rgba(16,9,20,.70)); box-shadow: inset 0 1px rgba(255,255,255,.025); }
.quote-card:nth-child(2) { background: linear-gradient(145deg, rgba(41,12,27,.64), rgba(17,8,17,.72)); }
.quote-label, .eyebrow { display: block; color: #b98ad7; text-transform: uppercase; letter-spacing: .13em; font-size: .6rem; font-weight: 900; }
.quote-card p { margin: 7px 0 0; font-size: .83rem; color: #e4dae9; line-height: 1.42; }

.player-card { position: relative; flex: 1; min-height: 0; padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(155deg, rgba(30,17,37,.91), rgba(12,7,16,.96) 58%, rgba(33,7,19,.90)); box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.035); overflow: hidden; }
.player-card::after { content: ""; position: absolute; width: 280px; height: 280px; border-radius: 50%; right: -160px; top: -150px; background: rgba(173,78,232,.12); filter: blur(20px); pointer-events: none; }
.now-playing { position: relative; z-index: 1; display: grid; grid-template-columns: 148px minmax(0,1fr); gap: 22px; align-items: center; }
.current-artwork { width: 148px; aspect-ratio: 1; border-radius: 25px; overflow: hidden; border: 1px solid rgba(238,207,255,.16); background: radial-gradient(circle at 33% 25%, #4f2463, #120c18 65%); box-shadow: 0 24px 48px rgba(0,0,0,.30); display: grid; place-items: center; }
.current-artwork img { width: 100%; height: 100%; object-fit: cover; }
.disc { width: 76%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; position: relative; background: radial-gradient(circle, #0a070c 0 17%, #28122f 18% 20%, #08060a 21% 37%, #32113a 38% 39%, #09070b 40%); box-shadow: inset 0 0 30px rgba(185,93,255,.16); }
.disc-ring { position: absolute; inset: 10%; border: 1px solid rgba(255,255,255,.06); border-radius: 50%; }
.disc-center { width: 34%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg,#a95fe0,#78163d); font-size: .65rem; font-weight: 900; }
.is-playing .disc { animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.track-copy { min-width: 0; }
.track-copy h2 { margin: 7px 0 5px; font-size: clamp(1.25rem, 2.2vw, 2.05rem); line-height: 1.12; letter-spacing: -.035em; overflow-wrap: anywhere; }
.track-copy > p { margin: 0; color: var(--muted); font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-up { margin-top: 18px; padding: 10px 12px; border-radius: 13px; border: 1px solid rgba(197,106,255,.13); background: rgba(197,106,255,.055); display: grid; gap: 3px; min-width: 0; }
.next-up span { color: var(--muted); font-size: .59rem; text-transform: uppercase; letter-spacing: .09em; }
.next-up strong { min-width: 0; color: #d8c9de; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress-block { margin-top: 27px; }
.range { width: 100%; accent-color: var(--purple-2); cursor: pointer; }
.progress-range { height: 5px; }
.time-row { display: flex; justify-content: space-between; margin-top: 5px; color: var(--muted); font-size: .65rem; }
.transport-controls { display: flex; justify-content: center; align-items: center; gap: 13px; margin: 22px 0; }
.round-button, .play-button { border: 1px solid var(--line); background: rgba(255,255,255,.045); display: grid; place-items: center; cursor: pointer; }
.round-button { width: 48px; height: 48px; border-radius: 17px; color: #d5cbd9; font-size: 1rem; }
.round-button.small { width: 40px; height: 40px; border-radius: 14px; color: #b5aab9; }
.round-button.active { color: #e6c4ff; border-color: rgba(190,112,244,.48); background: rgba(145,60,200,.19); }
.play-button { width: 70px; height: 70px; border-radius: 25px; border-color: rgba(224,181,255,.35); background: linear-gradient(145deg, #a74ee4, #8a164a); color: #fff; font-size: 1.22rem; box-shadow: 0 16px 38px rgba(108,25,141,.32); }
.play-button .pause-icon { display: none; }
.is-playing .play-button .play-icon { display: none; }
.is-playing .play-button .pause-icon { display: inline; }
.repeat-one { display: none; font-size: .55rem; margin-left: 1px; }
.repeat-one.visible { display: inline; }
.utility-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 2px; }
.volume-control { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.volume-range { max-width: 170px; }
.sleep-button { min-height: 40px; border-radius: 13px; padding: 0 13px; border: 1px solid var(--line); background: rgba(255,255,255,.035); color: #d1c7d5; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .72rem; }
.sleep-button.active { border-color: rgba(192,106,245,.45); color: #e9cbff; }
.player-footer-line { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; padding-top: 13px; border-top: 1px solid rgba(255,255,255,.055); }
.status-line { margin: 0; color: var(--muted); font-size: .68rem; }
.status-line.failed { color: var(--danger); }
.tracking-notice { color: #766d7c; font-size: .58rem; text-align: right; }

.playlist-panel { display: flex; flex-direction: column; min-height: 0; height: calc(100vh - 112px); padding: 20px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(150deg, rgba(20,12,25,.93), rgba(10,7,13,.95)); box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.03); }
.playlist-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.playlist-head h2 { margin: 5px 0 0; font-size: 1.34rem; letter-spacing: -.03em; }
.playlist-tools { display: grid; gap: 10px; margin-top: 14px; }
.library-source-row, .playlist-sort-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; }
.source-box, .sort-box { min-width: 0; height: 49px; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 9px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.028); }
.source-box span, .sort-box span { color: var(--muted); font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; }
.source-box select, .sort-box select { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; text-align: right; font-size: .76rem; }
.source-box option, .sort-box option { background: #140d18; }
.new-playlist-button, .randomize-list-button { min-height: 49px; border-radius: 14px; border: 1px solid rgba(190,108,242,.25); background: linear-gradient(145deg, rgba(148,64,202,.20), rgba(105,21,61,.16)); color: #e8d8f2; padding: 0 14px; cursor: pointer; font-weight: 800; font-size: .72rem; white-space: nowrap; }
.new-playlist-button:hover, .randomize-list-button:hover { border-color: rgba(212,148,255,.48); background: linear-gradient(145deg, rgba(156,68,214,.31), rgba(127,25,73,.25)); }
.randomize-list-button { display: flex; align-items: center; gap: 7px; }
.randomize-list-button.active { border-color: rgba(215,154,255,.52); color: #f0dcff; }
.random-label-short { display: none; }
.playlist-manage-row { display: flex; gap: 8px; }
.playlist-manage-row button { border: 1px solid var(--line); background: rgba(255,255,255,.028); color: var(--soft); border-radius: 11px; min-height: 34px; padding: 0 11px; font-size: .66rem; cursor: pointer; }
.playlist-manage-row .danger { color: #ff97b5; border-color: rgba(255,114,155,.16); }
.search-box { height: 45px; display: flex; align-items: center; gap: 9px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.18); color: var(--muted); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: .78rem; }
.search-box input::placeholder { color: #6f6674; }

.recent-section { margin-top: 15px; }
.section-heading, .all-tracks-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading h3 { margin: 0; font-size: .75rem; letter-spacing: .01em; }
.section-note, #libraryStatus { color: #776e7c; font-size: .58rem; }
.recent-tracks { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 7px; margin-top: 8px; }
.recent-track-card { min-width: 0; min-height: 70px; padding: 8px; border-radius: 13px; border: 1px solid rgba(255,255,255,.055); background: rgba(255,255,255,.025); color: var(--text); display: grid; grid-template-columns: 30px minmax(0,1fr); align-items: center; gap: 7px; text-align: left; cursor: pointer; overflow: hidden; }
.recent-track-card:hover { border-color: rgba(190,110,244,.25); background: rgba(151,65,205,.07); }
.recent-track-icon { width: 30px; height: 30px; border-radius: 9px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(145deg, rgba(156,70,210,.28), rgba(112,20,62,.28)); color: #d8b8ec; font-size: .72rem; }
.recent-track-icon img { width: 100%; height: 100%; object-fit: cover; }
.recent-track-copy { min-width: 0; display: grid; gap: 3px; }
.recent-track-title, .recent-track-date { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-track-title { font-size: .62rem; font-weight: 800; }
.recent-track-date { color: var(--muted); font-size: .52rem; }
.new-badge { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-height: 16px; padding: 0 5px; border-radius: 6px; background: rgba(160,55,112,.22); color: #ff9abd; border: 1px solid rgba(255,112,158,.16); font-size: .46rem; font-weight: 900; letter-spacing: .05em; }
.recent-new-badge { display: none; }

.all-tracks-heading { margin-top: 14px; padding: 0 3px 7px; }
.all-tracks-heading > span:first-child { font-size: .68rem; font-weight: 800; color: #d9cedf; }
.playlist { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(169,94,215,.32) transparent; padding-right: 3px; }
.track-row { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; column-gap: 10px; min-height: 59px; padding: 7px 7px; border-radius: 13px; border: 1px solid transparent; cursor: pointer; outline: 0; }
.track-row:hover { background: rgba(255,255,255,.025); border-color: rgba(255,255,255,.04); }
.track-row.active { background: linear-gradient(90deg, rgba(148,66,201,.12), rgba(119,18,61,.08)); border-color: rgba(192,113,244,.16); }
.track-row.failed { opacity: .42; }
.track-art { width: 42px; height: 42px; border-radius: 11px; overflow: hidden; display: grid; place-items: center; background: rgba(255,255,255,.04); color: #7f7485; }
.track-art img { width: 100%; height: 100%; object-fit: cover; }
.track-number { font-size: .57rem; font-weight: 800; }
.track-meta { min-width: 0; display: grid; gap: 3px; }
.track-name-line { min-width: 0; display: flex; align-items: center; gap: 7px; }
.track-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; font-weight: 750; color: #e9e1ed; }
.track-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #7f7584; font-size: .56rem; }
.track-tail { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.track-state { width: 15px; color: #c77df2; font-size: .62rem; }
.track-action { min-width: 31px; height: 31px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: #bcb0c2; cursor: pointer; }
.track-action:hover { color: white; border-color: var(--line-strong); }
.track-action:disabled { opacity: .25; cursor: default; }
.track-action.remove { color: #ff8eaf; }
.track-action.add { width: auto; min-width: 104px; height: 38px; padding: 0 13px; border-radius: 12px; color: #fff; font-size: .69rem; font-weight: 850; border-color: rgba(203,127,255,.30); background: linear-gradient(135deg, rgba(152,66,206,.26), rgba(128,24,68,.30)); }
.track-action.add:hover { background: linear-gradient(135deg, rgba(168,78,223,.41), rgba(151,31,80,.43)); }

.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.66); backdrop-filter: blur(5px); }
.sleep-modal, .playlist-choice-modal { position: fixed; z-index: 70; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(440px, calc(100% - 24px)); padding: 20px; border-radius: 22px; border: 1px solid var(--line-strong); background: linear-gradient(150deg, #211329, #0f0a13 70%, #24101b); box-shadow: 0 30px 90px rgba(0,0,0,.68); }
.modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-heading h2 { margin: 5px 0 0; font-size: 1.15rem; }
.modal-handle { display: none; }
.timer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0; }
.timer-grid button, .wide-action, .custom-timer button { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: #e2d7e7; cursor: pointer; }
.custom-timer { display: grid; gap: 7px; margin-bottom: 10px; }
.custom-timer label { color: var(--muted); font-size: .65rem; }
.custom-timer > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.custom-timer input { min-width: 0; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.22); color: white; padding: 0 11px; }
.wide-action { width: 100%; margin-top: 8px; }
.wide-action.secondary { color: var(--muted); }
.playlist-choice-list { display: grid; gap: 7px; max-height: 330px; overflow-y: auto; margin: 15px 0; }
.playlist-choice-button { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.035); color: #e5dce9; text-align: left; padding: 0 12px; cursor: pointer; }
.playlist-choice-empty { color: var(--muted); font-size: .75rem; }

/* Login */
.login-body { display: grid; place-items: center; overflow-x: hidden; }
.login-shell { width: min(100%, 760px); padding: 24px; }
.login-card { position: relative; overflow: hidden; width: min(100%, 490px); margin: 0 auto; padding: 34px; border-radius: 30px; border: 1px solid rgba(220,174,255,.20); background: linear-gradient(155deg, rgba(32,18,40,.96), rgba(10,7,13,.98) 58%, rgba(39,8,22,.96)); box-shadow: 0 40px 110px rgba(0,0,0,.58); }
.login-orbit { position: absolute; border-radius: 50%; filter: blur(10px); pointer-events: none; }
.orbit-a { width: 190px; height: 190px; right: -100px; top: -100px; background: rgba(157,72,215,.15); }
.orbit-b { width: 150px; height: 150px; left: -95px; bottom: -95px; background: rgba(137,13,60,.18); }
.login-brand { position: relative; display: flex; align-items: center; gap: 15px; }
.login-brand h1 { margin: 5px 0 2px; font-size: clamp(1.6rem, 5vw, 2.15rem); letter-spacing: -.045em; }
.login-brand p { margin: 0; color: var(--muted); font-size: .78rem; }
.login-equalizer { position: relative; height: 40px; margin: 28px 0 22px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.login-equalizer i { display: block; width: 5px; height: 12px; border-radius: 8px; background: linear-gradient(#c16bf6,#8f174c); animation: eq 1.2s ease-in-out infinite alternate; }
.login-equalizer i:nth-child(2n) { animation-delay: -.4s; }
.login-equalizer i:nth-child(3n) { animation-delay: -.8s; }
.login-equalizer i:nth-child(4n) { animation-delay: -.2s; }
@keyframes eq { from { height: 8px; opacity: .45; } to { height: 34px; opacity: 1; } }
.login-form { position: relative; display: grid; gap: 12px; }
.login-form label { display: grid; gap: 6px; }
.login-form label span { color: var(--muted); font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; }
.login-form input { height: 50px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.24); color: white; padding: 0 14px; outline: 0; }
.login-form input:focus { border-color: rgba(202,128,250,.48); box-shadow: 0 0 0 3px rgba(151,65,205,.08); }
.login-submit { height: 52px; margin-top: 4px; border: 1px solid rgba(223,178,255,.24); border-radius: 15px; background: linear-gradient(145deg,#a54ce0,#8a1749); color: white; font-weight: 900; cursor: pointer; box-shadow: 0 14px 34px rgba(104,23,133,.25); }
.login-error { position: relative; margin: 0 0 13px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255,111,154,.20); background: rgba(123,18,60,.18); color: #ffb0c7; font-size: .72rem; }
.login-foot { position: relative; margin: 18px 0 0; color: #655d6a; font-size: .6rem; text-align: center; }

/* Admin */
.admin-body { min-height: 100vh; }
.admin-shell { width: min(1480px, calc(100% - 28px)); margin: 0 auto; padding: 18px 0 32px; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.admin-notice { margin-bottom: 12px; padding: 11px 13px; border-radius: 12px; font-size: .72rem; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.admin-notice.success { color: #a9e8c7; border-color: rgba(124,214,170,.19); }
.admin-notice.error { color: #ff9fba; border-color: rgba(255,114,155,.20); }
.admin-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 11px; }
.user-stat-card, .admin-panel { border: 1px solid var(--line); background: linear-gradient(150deg, rgba(25,14,31,.88), rgba(11,7,14,.94)); border-radius: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.22); }
.user-stat-card { padding: 14px; }
.user-stat-head { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 9px; }
.user-stat-head > div:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.user-stat-head strong { font-size: .82rem; }
.user-stat-head span { color: var(--muted); font-size: .62rem; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #544d58; box-shadow: 0 0 0 4px rgba(255,255,255,.025); }
.live-dot.on { background: #77d8a7; box-shadow: 0 0 0 4px rgba(119,216,167,.08), 0 0 16px rgba(119,216,167,.35); }
.user-stat-now { display: grid; gap: 3px; margin: 12px 0; padding: 8px 9px; border-radius: 11px; background: rgba(255,255,255,.025); }
.user-stat-now span, .mini-stat-grid span { color: var(--muted); font-size: .55rem; text-transform: uppercase; letter-spacing: .07em; }
.user-stat-now strong { font-size: .67rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.mini-stat-grid > div { display: grid; gap: 3px; }
.mini-stat-grid strong { font-size: .7rem; }
.admin-columns { display: grid; grid-template-columns: minmax(420px,.85fr) minmax(560px,1.15fr); gap: 12px; margin-top: 12px; }
.admin-panel { padding: 17px; min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel-heading h2 { margin: 4px 0 0; font-size: 1.05rem; }
.admin-create-user { display: grid; grid-template-columns: 1fr 1fr 1.2fr auto; gap: 7px; margin: 15px 0; }
.admin-create-user input, .password-form input, .admin-user-select select { min-width: 0; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.19); color: white; padding: 0 9px; outline: 0; }
.admin-create-user button, .mini-button { border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.035); color: var(--soft); padding: 0 10px; cursor: pointer; }
.admin-create-user button { color: white; background: linear-gradient(145deg, rgba(151,65,205,.35), rgba(124,20,65,.32)); }
.admin-user-list { display: grid; gap: 7px; }
.admin-user-row { padding: 10px; border-radius: 14px; border: 1px solid rgba(255,255,255,.05); background: rgba(255,255,255,.018); }
.admin-user-main { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 9px; align-items: center; }
.admin-user-main > div:nth-child(2) { display: grid; gap: 2px; }
.admin-user-main strong { font-size: .75rem; }
.admin-user-main span { color: var(--muted); font-size: .57rem; }
.account-state { padding: 4px 7px; border-radius: 8px; font-size: .55rem !important; }
.account-state.active { color: #8ce1b2 !important; background: rgba(124,214,170,.08); }
.account-state.off { color: #ff8eae !important; background: rgba(255,114,155,.08); }
.admin-user-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.admin-user-actions form { display: flex; gap: 5px; }
.password-form { flex: 1; min-width: 220px; }
.password-form input { flex: 1; height: 34px; }
.mini-button { min-height: 34px; font-size: .59rem; }
.mini-button.danger { color: #ff8eae; border-color: rgba(255,114,155,.15); }
.history-heading { align-items: end; }
.admin-user-select { display: grid; gap: 4px; }
.admin-user-select span { color: var(--muted); font-size: .55rem; }
.history-table-wrap { overflow: auto; max-height: 560px; margin-top: 13px; border: 1px solid rgba(255,255,255,.045); border-radius: 13px; }
.history-table { width: 100%; border-collapse: collapse; font-size: .66rem; }
.history-table th, .history-table td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.04); text-align: left; }
.history-table th { position: sticky; top: 0; z-index: 1; background: #160e1b; color: var(--muted); font-size: .56rem; text-transform: uppercase; letter-spacing: .06em; }
.history-table td:nth-child(2) { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-table { color: var(--muted); text-align: center !important; }
.admin-refresh-note { color: #645d68; font-size: .56rem; margin: 8px 2px 0; }

/* Self destruct remains available but normally disabled */
body.destruct-open { overflow: hidden !important; }
.destruct-gate { position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; padding: 20px; background: rgba(5,3,8,.94); backdrop-filter: blur(12px); }
.destruct-card { width: min(520px,100%); padding: 28px; border-radius: 25px; border: 1px solid rgba(205,138,255,.26); background: linear-gradient(150deg,#2a1535,#0d0911 58%,#2b0a1c); box-shadow: 0 34px 100px rgba(0,0,0,.72); }
.destruct-kicker { color: #c994ef; font-size: .65rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.destruct-kicker.danger { color: #ff87af; }
.destruct-card h2 { margin: 7px 0 0; }
.destruct-card p { color: var(--soft); line-height: 1.55; }
.destruct-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 22px; }
.destruct-button { min-height: 48px; border-radius: 13px; border: 1px solid var(--line); cursor: pointer; }
.destruct-button.keep { background: rgba(154,76,224,.16); }
.destruct-button.delete { background: rgba(123,18,60,.34); color: #ffd8e4; }
.destruct-status { color: #ffafc5; }

.empty-state { min-height: 60vh; display: grid; place-items: center; text-align: center; align-content: center; }
.empty-state h2 { margin: 10px 0 0; }
.empty-state p { color: var(--muted); max-width: 600px; }
.empty-note { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: rgba(154,76,224,.12); font-size: 1.6rem; }

@media (max-width: 1120px) {
    .v5-main { grid-template-columns: minmax(350px,.9fr) minmax(470px,1.1fr); }
    .recent-tracks { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .recent-track-card:nth-child(n+4) { display: none; }
    .admin-columns { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .app-shell { width: min(100%, calc(100% - 16px)); padding-top: 9px; }
    .topbar { min-height: 58px; padding: 0 2px 9px; }
    .brand-mark { width: 40px; height: 40px; border-radius: 13px; }
    .brand-text p, .desktop-account-link, .account-copy, .account-logout { display: none; }
    .account-chip { padding: 3px; border: 0; background: transparent; }
    .mobile-only { display: inline-grid; }
    .v5-main { display: block; min-height: auto; }
    .welcome-strip { padding: 0 4px 5px; }
    .quote-zone { gap: 7px; }
    .quote-card { min-height: 72px; padding: 10px 11px; border-radius: 15px; }
    .quote-card p { font-size: .72rem; }
    .player-card { padding: 16px; border-radius: 20px; }
    .now-playing { grid-template-columns: 96px minmax(0,1fr); gap: 14px; }
    .current-artwork { width: 96px; border-radius: 19px; }
    .track-copy h2 { font-size: 1.18rem; }
    .next-up { margin-top: 11px; padding: 8px 9px; }
    .transport-controls { margin: 17px 0; gap: 10px; }
    .play-button { width: 62px; height: 62px; border-radius: 22px; }
    .round-button { width: 44px; height: 44px; border-radius: 15px; }
    .round-button.small { width: 38px; height: 38px; }
    .player-footer-line { margin-top: 12px; }
    .tracking-notice { display: none; }

    .playlist-panel { position: fixed; z-index: 65; inset: 8px; height: auto; transform: translateY(110%); transition: transform .22s ease; border-radius: 24px; padding: 15px; }
    body.playlist-open .playlist-panel { transform: translateY(0); }
    .playlist-head { padding-bottom: 2px; }
    .playlist-tools { gap: 7px; margin-top: 9px; }
    .library-source-row, .playlist-sort-row { grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
    .source-box, .sort-box { height: 43px; border-radius: 12px; padding: 0 9px; }
    .new-playlist-button, .randomize-list-button { min-height: 43px; border-radius: 12px; padding: 0 11px; }
    .random-label-long { display: none; }
    .random-label-short { display: inline; }
    .search-box { height: 41px; border-radius: 12px; }
    .recent-section { margin-top: 9px; }
    .recent-tracks { grid-template-columns: repeat(5, minmax(0,1fr)); overflow-x: auto; padding-bottom: 2px; }
    .recent-track-card { display: grid !important; min-width: 145px; min-height: 58px; }
    .all-tracks-heading { margin-top: 8px; }
    .track-row { grid-template-columns: 38px minmax(0,1fr) auto; min-height: 54px; padding: 5px; column-gap: 8px; }
    .track-art { width: 38px; height: 38px; }
    .track-action.add { min-width: 98px; height: 42px; padding: 0 11px; font-size: .66rem; }
    .sleep-modal, .playlist-choice-modal { left: 8px; right: 8px; bottom: 8px; top: auto; transform: none; width: auto; border-radius: 23px; }
    .modal-handle { display: block; width: 42px; height: 4px; margin: -5px auto 14px; border-radius: 9px; background: #514957; }

    .admin-shell { width: calc(100% - 16px); padding-top: 9px; }
    .admin-create-user { grid-template-columns: 1fr 1fr; }
    .admin-create-user input:nth-child(4) { grid-column: 1 / -1; }
    .admin-create-user button { min-height: 40px; }
}

@media (max-width: 560px) {
    .quote-zone { grid-template-columns: 1fr; }
    .quote-card:nth-child(2) { display: none; }
    .welcome-strip strong { display: none; }
    .now-playing { grid-template-columns: 78px minmax(0,1fr); gap: 11px; }
    .current-artwork { width: 78px; border-radius: 16px; }
    .track-copy h2 { font-size: 1.02rem; }
    .track-copy > p { font-size: .62rem; }
    .next-up { margin-top: 8px; }
    .utility-row { gap: 8px; }
    .volume-range { max-width: 105px; }
    .sleep-button { padding: 0 10px; }
    .player-footer-line { display: block; }
    .recent-track-card { min-width: 135px; }
    .track-action.add { min-width: 92px; height: 42px; padding: 0 9px; font-size: .62rem; }

    .login-shell { padding: 12px; }
    .login-card { padding: 24px 18px; border-radius: 24px; }
    .login-brand { align-items: flex-start; }
    .login-equalizer { margin: 22px 0 16px; }

    .admin-topbar { align-items: flex-start; }
    .admin-summary-grid { grid-template-columns: 1fr; }
    .admin-create-user { grid-template-columns: 1fr; }
    .admin-create-user input:nth-child(4) { grid-column: auto; }
    .password-form { min-width: 100%; }
    .history-heading { align-items: flex-start; flex-direction: column; }
    .admin-user-select { width: 100%; }
    .admin-user-select select { width: 100%; }
    .destruct-actions { grid-template-columns: 1fr; }
}


/* v5.0.14 – Adminzugang auch mobil */
.mobile-admin-link {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 12px;
    border: 1px solid rgba(193, 119, 255, .28);
    background: linear-gradient(135deg, rgba(119, 47, 169, .28), rgba(96, 15, 67, .28));
    color: #f3e6ff;
    font-size: .72rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.mobile-admin-link:hover,
.mobile-admin-link:focus-visible {
    border-color: rgba(220, 167, 255, .58);
    background: linear-gradient(135deg, rgba(143, 57, 194, .42), rgba(123, 20, 82, .42));
}

@media (max-width: 860px) {
    .mobile-admin-link.mobile-only {
        display: inline-flex;
    }
}

@media (max-width: 390px) {
    .mobile-admin-link {
        min-height: 36px;
        padding: 0 8px;
        font-size: .68rem;
    }
}


/* v5.0.14 – ausführliche benutzergetrennte Admin-Statistik */
.admin-shell-detailed {
    width: min(1520px, calc(100% - 28px));
}

.admin-detail-panel {
    margin-top: 12px;
}

.admin-live-grid {
    display: grid;
    grid-template-columns: minmax(340px, 1.15fr) minmax(420px, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.admin-live-panel {
    min-width: 0;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 18px;
    background:
        radial-gradient(circle at 90% 10%, rgba(145,51,191,.13), transparent 38%),
        rgba(255,255,255,.018);
}

.admin-live-panel.active {
    border-color: rgba(180,92,232,.28);
    box-shadow: 0 0 0 1px rgba(171,74,224,.04), 0 18px 50px rgba(75,16,105,.12);
}

.admin-live-state {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: .65rem;
    font-weight: 700;
}

.admin-live-panel h3 {
    margin: 13px 0 4px;
    font-size: clamp(1rem, 2vw, 1.35rem);
    overflow-wrap: anywhere;
}

.admin-live-panel p {
    margin: 0;
    color: var(--muted);
    font-size: .62rem;
    overflow-wrap: anywhere;
}

.admin-progress {
    height: 6px;
    margin-top: 20px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
}

.admin-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #9a45cb, #9a1d59);
    transition: width .25s ease;
}

.admin-position {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    color: #85798a;
    font-size: .57rem;
}

.admin-detail-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 8px;
}

.admin-detail-cards article {
    display: grid;
    align-content: center;
    min-height: 78px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.055);
    border-radius: 15px;
    background: rgba(255,255,255,.018);
}

.admin-detail-cards span {
    color: var(--muted);
    font-size: .56rem;
}

.admin-detail-cards strong {
    margin-top: 5px;
    font-size: .82rem;
    overflow-wrap: anywhere;
}

.admin-columns-v502 {
    grid-template-columns: minmax(400px,.78fr) minmax(650px,1.22fr);
}

.history-counter {
    color: var(--muted);
    font-size: .57rem;
}

.detailed-history-table {
    min-width: 760px;
}

.history-title {
    color: #eee4f3;
    font-weight: 700;
    font-size: .68rem;
}

.history-file {
    margin-top: 3px;
    color: #716878;
    font-size: .54rem;
    overflow-wrap: anywhere;
}

.state-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 999px;
    color: #bdb0c4;
    background: rgba(255,255,255,.025);
    font-size: .55rem;
    white-space: nowrap;
}

.state-pill.state-playing {
    color: #c9f2da;
    border-color: rgba(102,210,153,.20);
    background: rgba(54,138,94,.10);
}

.state-pill.state-paused {
    color: #e9d29e;
    border-color: rgba(221,183,91,.20);
    background: rgba(142,104,29,.10);
}

.state-pill.state-ended {
    color: #bfc4e7;
    border-color: rgba(123,132,210,.18);
    background: rgba(64,72,145,.09);
}

.state-pill.state-skipped,
.state-pill.state-error {
    color: #f3a9bd;
    border-color: rgba(222,82,120,.20);
    background: rgba(143,34,67,.10);
}

.admin-days-panel {
    margin-top: 12px;
}

@media (max-width: 1120px) {
    .admin-live-grid {
        grid-template-columns: 1fr;
    }

    .admin-columns-v502 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .admin-shell-detailed {
        width: calc(100% - 14px);
    }

    .admin-detail-cards {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .admin-live-panel {
        padding: 14px;
    }

    .admin-detail-panel {
        padding: 13px;
    }
}

@media (max-width: 390px) {
    .admin-detail-cards {
        grid-template-columns: 1fr 1fr;
    }

    .admin-detail-cards article {
        min-height: 68px;
        padding: 10px;
    }
}


/* v5.0.14 – Statistik-Facelift */
.admin-body {
    background:
        radial-gradient(circle at 8% 4%, rgba(122, 45, 174, .11), transparent 30%),
        radial-gradient(circle at 92% 18%, rgba(112, 8, 52, .10), transparent 30%),
        #08060a;
}

.admin-detail-panel,
.pretty-history-panel,
.pretty-days-panel {
    position: relative;
    overflow: hidden;
}

.admin-detail-panel::before,
.pretty-history-panel::before,
.pretty-days-panel::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(198, 117, 255, .28), rgba(158, 20, 86, .24), transparent);
    pointer-events: none;
}

.stats-hero-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,.045);
}

.stats-user-identity {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.stats-avatar {
    flex: 0 0 auto;
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    border: 1px solid rgba(205, 137, 255, .28);
    background:
        linear-gradient(145deg, rgba(142, 61, 190, .42), rgba(112, 18, 66, .40));
    box-shadow: inset 0 1px rgba(255,255,255,.05), 0 12px 28px rgba(61, 12, 83, .18);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 900;
}

.stats-user-identity h2 {
    margin: 2px 0 2px;
    font-size: 1.25rem;
}

.stats-account-note {
    color: #776d7d;
    font-size: .58rem;
}

.stats-user-select {
    min-width: 190px;
}

.stats-user-select select {
    width: 100%;
    border-color: rgba(191, 113, 244, .18);
    background: rgba(14, 9, 17, .82);
}

.stats-live-grid {
    margin-top: 16px;
    grid-template-columns: minmax(360px, 1.1fr) minmax(440px, 1fr);
    gap: 14px;
}

.admin-live-panel {
    min-height: 190px;
    padding: 22px;
    border-radius: 20px;
    background:
        radial-gradient(circle at 88% 12%, rgba(170, 70, 223, .15), transparent 36%),
        radial-gradient(circle at 15% 88%, rgba(129, 13, 66, .12), transparent 34%),
        linear-gradient(145deg, rgba(28, 16, 34, .90), rgba(11, 7, 14, .94));
}

.admin-live-panel.active {
    border-color: rgba(189, 105, 240, .34);
    box-shadow:
        0 0 0 1px rgba(169, 74, 224, .05),
        0 24px 60px rgba(64, 15, 83, .18);
}

.admin-live-state {
    width: fit-content;
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(255,255,255,.045);
}

.admin-live-panel h3 {
    margin-top: 22px;
    font-size: clamp(1.12rem, 2vw, 1.52rem);
    letter-spacing: -.02em;
}

.admin-live-panel p {
    margin-top: 5px;
    color: #807686;
}

.admin-progress {
    height: 8px;
    margin-top: 26px;
    background: rgba(255,255,255,.045);
}

.admin-progress span {
    background: linear-gradient(90deg, #9b4fd0, #b1216a);
    box-shadow: 0 0 16px rgba(161, 67, 202, .22);
}

.pretty-stat-cards {
    gap: 10px;
}

.pretty-stat-cards article {
    position: relative;
    overflow: hidden;
    min-height: 92px;
    padding: 14px 14px 13px;
    border-radius: 17px;
    border: 1px solid rgba(255,255,255,.052);
    background:
        linear-gradient(155deg, rgba(255,255,255,.025), rgba(255,255,255,.010));
}

.pretty-stat-cards article::after {
    content: "";
    position: absolute;
    right: -24px;
    bottom: -26px;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: rgba(139, 48, 177, .08);
}

.pretty-stat-cards i {
    position: relative;
    z-index: 1;
    display: block;
    margin-bottom: 12px;
    color: rgba(194, 132, 235, .42);
    font-style: normal;
    font-size: .48rem;
    font-weight: 900;
    letter-spacing: .12em;
}

.pretty-stat-cards span,
.pretty-stat-cards strong {
    position: relative;
    z-index: 1;
}

.pretty-stat-cards strong {
    margin-top: 6px;
    font-size: .92rem;
    color: #f3eaf7;
}

.user-stat-card {
    border-color: rgba(255,255,255,.05);
    background:
        radial-gradient(circle at 92% 5%, rgba(138, 53, 183, .09), transparent 35%),
        linear-gradient(150deg, rgba(25,14,31,.88), rgba(11,7,14,.94));
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.user-stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(191, 112, 240, .18);
    box-shadow: 0 24px 58px rgba(0,0,0,.26);
}

.pretty-history-panel,
.pretty-days-panel {
    background:
        linear-gradient(150deg, rgba(24,14,29,.91), rgba(10,7,13,.95));
}

.history-heading {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,.04);
}

.history-heading h2,
.pretty-days-panel .panel-heading h2 {
    font-size: 1rem;
}

.history-counter {
    padding: 5px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.055);
    background: rgba(255,255,255,.022);
}

.history-table-wrap {
    max-height: 600px;
    border-color: rgba(255,255,255,.04);
    background: rgba(4,3,6,.20);
}

.history-table th {
    background: rgba(20, 12, 25, .98);
    color: #85798b;
    backdrop-filter: blur(10px);
}

.history-table tbody tr {
    transition: background .12s ease;
}

.history-table tbody tr:hover {
    background: rgba(174, 92, 221, .035);
}

.history-table td {
    color: #b9adbF;
}

.history-title {
    font-size: .70rem;
}

.state-pill {
    min-height: 25px;
    padding: 0 9px;
    font-weight: 700;
}

.pretty-days-panel .history-table-wrap {
    max-height: none;
}

.admin-refresh-note {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid rgba(255,255,255,.035);
    color: #665e6a;
}

@media (max-width: 1120px) {
    .stats-live-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .stats-hero-head {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .stats-user-select {
        width: 100%;
        min-width: 0;
    }

    .stats-avatar {
        width: 46px;
        height: 46px;
        border-radius: 15px;
    }

    .admin-live-panel {
        min-height: 170px;
        padding: 17px;
    }

    .pretty-stat-cards {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .pretty-stat-cards article {
        min-height: 84px;
    }

    /* Mobile: Tabellen werden zu lesbaren Karten statt horizontaler Mini-Tabelle */
    .pretty-history-panel .history-table-wrap,
    .pretty-days-panel .history-table-wrap {
        overflow: visible;
        max-height: none;
        border: 0;
        background: transparent;
    }

    .pretty-history-panel .history-table,
    .pretty-history-panel .history-table tbody,
    .pretty-history-panel .history-table tr,
    .pretty-history-panel .history-table td,
    .pretty-days-panel .history-table,
    .pretty-days-panel .history-table tbody,
    .pretty-days-panel .history-table tr,
    .pretty-days-panel .history-table td {
        display: block;
        width: 100%;
    }

    .pretty-history-panel .history-table thead,
    .pretty-days-panel .history-table thead {
        display: none;
    }

    .pretty-history-panel .history-table tr,
    .pretty-days-panel .history-table tr {
        margin-bottom: 8px;
        padding: 11px 12px;
        border: 1px solid rgba(255,255,255,.045);
        border-radius: 14px;
        background: rgba(255,255,255,.016);
    }

    .pretty-history-panel .history-table td,
    .pretty-days-panel .history-table td {
        position: relative;
        max-width: none !important;
        padding: 5px 0 5px 43%;
        border: 0;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        min-height: 27px;
        font-size: .64rem;
    }

    .pretty-history-panel .history-table td::before,
    .pretty-days-panel .history-table td::before {
        position: absolute;
        left: 0;
        top: 5px;
        width: 39%;
        color: #746a79;
        font-size: .54rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .05em;
    }

    .pretty-history-panel .history-table td:nth-child(1)::before { content: "Beginn"; }
    .pretty-history-panel .history-table td:nth-child(2)::before { content: "Titel"; }
    .pretty-history-panel .history-table td:nth-child(3)::before { content: "Gehört"; }
    .pretty-history-panel .history-table td:nth-child(4)::before { content: "Status"; }
    .pretty-history-panel .history-table td:nth-child(5)::before { content: "Letzte Aktivität"; }

    .pretty-days-panel .history-table td:nth-child(1)::before { content: "Tag"; }
    .pretty-days-panel .history-table td:nth-child(2)::before { content: "Gehört"; }
    .pretty-days-panel .history-table td:nth-child(3)::before { content: "Titelstarts"; }
    .pretty-days-panel .history-table td:nth-child(4)::before { content: "Letzte Aktivität"; }

    .history-file {
        margin-top: 4px;
        white-space: normal;
    }
}

@media (max-width: 390px) {
    .pretty-stat-cards {
        grid-template-columns: 1fr 1fr;
        gap: 7px;
    }

    .pretty-stat-cards article {
        min-height: 78px;
        padding: 11px;
    }

    .pretty-history-panel .history-table td,
    .pretty-days-panel .history-table td {
        padding-left: 40%;
    }

    .pretty-history-panel .history-table td::before,
    .pretty-days-panel .history-table td::before {
        width: 36%;
    }
}


/* v5.0.14 – Benutzerkarten im Adminbereich komplett neu */
.admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.user-stat-card {
    position: relative;
    overflow: hidden;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 22px;
    background:
        radial-gradient(circle at 100% 0%, rgba(157, 58, 207, .13), transparent 34%),
        radial-gradient(circle at 0% 100%, rgba(128, 10, 61, .10), transparent 38%),
        linear-gradient(145deg, rgba(26,15,32,.96), rgba(10,7,13,.98));
    box-shadow:
        inset 0 1px rgba(255,255,255,.025),
        0 20px 48px rgba(0,0,0,.22);
    cursor: pointer;
    outline: none;
    transition:
        transform .16s ease,
        border-color .16s ease,
        box-shadow .16s ease,
        background .16s ease;
}

.user-stat-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(198,119,255,.26),
        rgba(151,20,82,.20),
        transparent
    );
    pointer-events: none;
}

.user-stat-card:hover,
.user-stat-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(197, 120, 247, .22);
    box-shadow:
        inset 0 1px rgba(255,255,255,.035),
        0 26px 62px rgba(0,0,0,.30);
}

.user-stat-card.is-selected {
    border-color: rgba(196, 112, 247, .42);
    box-shadow:
        inset 0 0 0 1px rgba(170, 75, 223, .08),
        0 0 0 1px rgba(154, 57, 202, .08),
        0 24px 60px rgba(65, 14, 87, .24);
}

.user-stat-card.is-playing {
    background:
        radial-gradient(circle at 100% 0%, rgba(112, 209, 159, .09), transparent 32%),
        radial-gradient(circle at 0% 100%, rgba(129, 13, 67, .10), transparent 38%),
        linear-gradient(145deg, rgba(26,15,32,.96), rgba(10,7,13,.98));
}

.user-stat-card-head {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center;
    gap: 12px;
}

.user-stat-avatar {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    border: 1px solid rgba(206, 140, 255, .25);
    background:
        linear-gradient(145deg, rgba(154, 64, 207, .58), rgba(133, 19, 72, .55));
    box-shadow:
        inset 0 1px rgba(255,255,255,.07),
        0 9px 24px rgba(72, 18, 90, .24);
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
}

.user-stat-identity {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.user-stat-name-line {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
}

.user-stat-name-line .user-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #f5ebf9;
    font-size: .92rem;
    font-weight: 850;
}

.user-handle {
    color: #887c8e;
    font-size: .64rem;
}

.user-role-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 7px;
    border: 1px solid rgba(198, 120, 249, .17);
    border-radius: 999px;
    background: rgba(139, 51, 185, .09);
    color: #be94d9;
    font-size: .48rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(255,255,255,.05);
    border-radius: 999px;
    background: rgba(255,255,255,.024);
    color: #887d8d;
    font-size: .58rem;
    font-weight: 750;
    white-space: nowrap;
}

.user-stat-card.is-playing .live-pill {
    border-color: rgba(102, 210, 153, .15);
    background: rgba(59, 143, 97, .07);
    color: #a7dcc0;
}

.user-stat-now {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 5px;
    margin: 16px 0 12px;
    padding: 12px 13px;
    border: 1px solid rgba(255,255,255,.045);
    border-radius: 14px;
    background: rgba(255,255,255,.018);
}

.user-stat-section-label {
    color: #746b79;
    font-size: .50rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.user-stat-now strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #dcd1e2;
    font-size: .70rem;
    font-weight: 720;
}

.user-stat-values {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 8px;
}

.user-stat-metric {
    min-width: 0;
    display: grid;
    gap: 5px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.04);
    border-radius: 13px;
    background:
        linear-gradient(150deg, rgba(255,255,255,.020), rgba(255,255,255,.008));
}

.user-stat-metric span {
    color: #756b7a;
    font-size: .50rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.user-stat-metric strong {
    min-width: 0;
    color: #f0e6f4;
    font-size: .78rem;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.user-stat-footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px solid rgba(255,255,255,.035);
}

.user-stat-footer span {
    color: #665d6b;
    font-size: .51rem;
}

.user-stat-footer strong {
    min-width: 0;
    color: #8f8395;
    font-size: .55rem;
    font-weight: 650;
    text-align: right;
}

@media (max-width: 860px) {
    .admin-summary-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 10px;
    }

    .user-stat-card {
        padding: 14px;
        border-radius: 18px;
    }

    .user-stat-avatar {
        width: 43px;
        height: 43px;
        border-radius: 14px;
        font-size: .90rem;
    }

    .user-stat-card-head {
        gap: 10px;
    }

    .user-stat-name-line .user-name {
        font-size: .84rem;
    }

    .live-pill {
        min-height: 28px;
        padding: 0 9px;
        font-size: .54rem;
    }

    .user-stat-now {
        margin: 13px 0 9px;
        padding: 10px 11px;
    }

    .user-stat-values {
        gap: 6px;
    }

    .user-stat-metric {
        padding: 9px 8px;
    }

    .user-stat-metric strong {
        font-size: .72rem;
    }
}

@media (max-width: 430px) {
    .user-stat-card {
        padding: 13px;
    }

    .user-stat-card-head {
        grid-template-columns: 42px minmax(0,1fr);
    }

    .live-pill {
        grid-column: 1 / -1;
        justify-self: start;
        margin-top: 2px;
    }

    .user-stat-avatar {
        width: 42px;
        height: 42px;
    }

    .user-stat-values {
        grid-template-columns: repeat(3, minmax(0,1fr));
    }

    .user-stat-metric {
        min-height: 58px;
        align-content: center;
    }

    .user-stat-metric span {
        font-size: .46rem;
    }

    .user-stat-metric strong {
        font-size: .68rem;
    }

    .user-stat-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .user-stat-footer strong {
        text-align: left;
    }
}


/* v5.0.14 – Admin direkt im Player statt separater Seitenwechsel */
body.admin-overlay-open {
    overflow: hidden !important;
}

.admin-overlay {
    position: fixed;
    inset: 0;
    z-index: 7000;
    display: grid;
    place-items: center;
    padding: 18px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s ease;
}

.admin-overlay[hidden] {
    display: none !important;
}

.admin-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.admin-overlay-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 10% 5%, rgba(121, 43, 169, .16), transparent 34%),
        radial-gradient(circle at 90% 85%, rgba(112, 8, 52, .18), transparent 34%),
        rgba(4, 3, 6, .88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.admin-overlay-panel {
    position: relative;
    z-index: 1;
    width: min(1540px, 96vw);
    height: min(920px, 94vh);
    display: grid;
    grid-template-rows: auto minmax(0,1fr);
    overflow: hidden;
    border: 1px solid rgba(200, 124, 250, .18);
    border-radius: 24px;
    background: #08060a;
    box-shadow:
        0 34px 120px rgba(0,0,0,.72),
        0 0 0 1px rgba(255,255,255,.015);
    transform: translateY(10px) scale(.992);
    transition: transform .16s ease;
}

.admin-overlay.is-open .admin-overlay-panel {
    transform: translateY(0) scale(1);
}

.admin-overlay-head {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 12px 10px 18px;
    border-bottom: 1px solid rgba(255,255,255,.045);
    background:
        linear-gradient(90deg, rgba(35,19,43,.96), rgba(14,9,17,.96));
}

.admin-overlay-head > div {
    display: grid;
    gap: 2px;
}

.admin-overlay-head strong {
    color: #f5eaf9;
    font-size: .86rem;
}

.admin-overlay-close {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 13px;
    background: rgba(255,255,255,.025);
    color: #e8dceb;
    font-size: 1.2rem;
    cursor: pointer;
}

.admin-overlay-close:hover {
    border-color: rgba(202,128,251,.22);
    background: rgba(144,58,190,.10);
}

.admin-overlay-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #08060a;
}

/* Im Overlay braucht admin.php keinen zweiten Kopf und keine Außenränder. */
.admin-embedded {
    min-height: 100vh;
    background: #08060a !important;
}

.admin-embedded .admin-topbar {
    display: none !important;
}

.admin-embedded .admin-shell {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 14px !important;
}

.admin-embedded .admin-summary-grid {
    margin-top: 0;
}

/* Userkarten ausdrücklich interaktiv */
.user-stat-card {
    -webkit-tap-highlight-color: transparent;
}

.user-stat-card[role="button"] {
    cursor: pointer !important;
}

.user-stat-card[role="button"]:active {
    transform: scale(.992);
}

.user-stat-card.is-selected {
    border-color: rgba(204,124,255,.46) !important;
    box-shadow:
        inset 0 0 0 1px rgba(187,89,238,.10),
        0 0 0 1px rgba(151,58,203,.10),
        0 20px 58px rgba(66,16,88,.28) !important;
}

@media (max-width: 860px) {
    .admin-overlay {
        padding: 0;
    }

    .admin-overlay-panel {
        width: 100vw;
        height: 100dvh;
        max-width: none;
        max-height: none;
        border: 0;
        border-radius: 0;
    }

    .admin-overlay-head {
        min-height: 54px;
        padding-left: 14px;
        padding-top: max(8px, env(safe-area-inset-top));
    }

    .admin-overlay-frame {
        min-height: 0;
    }

    .admin-embedded .admin-shell {
        padding: 9px !important;
    }
}


/* v5.0.14 – echtes Benutzerkonto im Player */
.account-chip-button {
    appearance: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.account-chip-button:hover,
.account-chip-button:focus-visible {
    border-color: rgba(198, 119, 248, .26);
    background: rgba(156, 60, 203, .08);
    outline: none;
}

.account-chevron {
    margin-left: 3px;
    color: #756b7a;
    font-size: .78rem;
    transition: transform .14s ease;
}

.account-chip-button[aria-expanded="true"] .account-chevron {
    transform: rotate(180deg);
}

body.account-overlay-open {
    overflow: hidden !important;
}

.account-overlay {
    position: fixed;
    inset: 0;
    z-index: 7600;
    display: grid;
    place-items: center;
    padding: 18px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}

.account-overlay[hidden] {
    display: none !important;
}

.account-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.account-overlay-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 14% 10%, rgba(128, 44, 177, .16), transparent 34%),
        radial-gradient(circle at 86% 85%, rgba(117, 7, 54, .18), transparent 35%),
        rgba(4, 3, 6, .88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.account-panel {
    position: relative;
    z-index: 1;
    width: min(560px, 96vw);
    max-height: min(860px, 94vh);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0,1fr);
    border: 1px solid rgba(200, 125, 250, .18);
    border-radius: 24px;
    background:
        radial-gradient(circle at 100% 0%, rgba(137, 48, 183, .13), transparent 32%),
        linear-gradient(150deg, rgba(27, 15, 33, .99), rgba(9, 6, 12, .995));
    box-shadow: 0 34px 110px rgba(0,0,0,.70);
    transform: translateY(10px) scale(.992);
    transition: transform .15s ease;
}

.account-overlay.is-open .account-panel {
    transform: translateY(0) scale(1);
}

.account-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 17px 17px 15px;
    border-bottom: 1px solid rgba(255,255,255,.045);
}

.account-panel-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-panel-avatar {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    border: 1px solid rgba(205, 136, 255, .24);
    background: linear-gradient(145deg, rgba(157, 63, 209, .65), rgba(135, 18, 72, .60));
    color: #fff;
    font-weight: 900;
    box-shadow: 0 10px 26px rgba(73, 15, 92, .25);
}

.account-panel-identity h2 {
    margin: 2px 0 2px;
    color: #f5ebf9;
    font-size: 1.05rem;
}

.account-panel-identity p {
    margin: 0;
    color: #817687;
    font-size: .62rem;
}

.account-panel-close {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 13px;
    background: rgba(255,255,255,.022);
    color: #eadfed;
    font-size: 1.2rem;
    cursor: pointer;
}

.account-panel-body {
    overflow: auto;
    padding: 16px;
}

.account-form {
    display: grid;
    gap: 11px;
}

.account-form label {
    display: grid;
    gap: 6px;
}

.account-form label > span,
.account-section-title span {
    color: #827688;
    font-size: .57rem;
    font-weight: 700;
}

.account-form input[type="text"],
.account-form input[type="email"],
.account-form input[type="password"],
.account-form input:not([type]) {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 13px;
    padding: 0 12px;
    background: rgba(5,3,7,.42);
    color: #f0e7f4;
    outline: none;
}

.account-form input:focus {
    border-color: rgba(197, 117, 247, .34);
    box-shadow: 0 0 0 3px rgba(139, 53, 185, .08);
}

.account-toggle-row {
    grid-template-columns: minmax(0,1fr) auto !important;
    align-items: center;
    gap: 16px !important;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.05);
    border-radius: 14px;
    background: rgba(255,255,255,.016);
}

.account-toggle-row > span {
    display: grid;
    gap: 3px;
}

.account-toggle-row > span strong {
    color: #eaddf0;
    font-size: .69rem;
}

.account-toggle-row > span small {
    color: #746a79;
    font-size: .55rem;
}

.account-toggle-row input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: #a83cc2;
}

.account-primary-button,
.account-secondary-button {
    min-height: 45px;
    border: 1px solid rgba(202, 125, 252, .22);
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(149, 56, 194, .42), rgba(135, 18, 72, .45));
    color: #fff;
    font: inherit;
    font-size: .66rem;
    font-weight: 850;
    cursor: pointer;
}

.account-secondary-button {
    background: rgba(255,255,255,.025);
    border-color: rgba(255,255,255,.07);
}

.account-primary-button:disabled,
.account-secondary-button:disabled {
    opacity: .45;
    cursor: wait;
}

.account-divider {
    height: 1px;
    margin: 17px 0;
    background: rgba(255,255,255,.045);
}

.account-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.account-section-title strong {
    color: #eaddf0;
    font-size: .73rem;
}

.account-message {
    margin-top: 13px;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    font-size: .61rem;
}

.account-message.success {
    color: #b7e7cb;
    border-color: rgba(89, 191, 137, .17);
    background: rgba(43, 128, 82, .08);
}

.account-message.error {
    color: #f0afc2;
    border-color: rgba(218, 77, 117, .18);
    background: rgba(137, 30, 63, .08);
}

.account-bottom-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.account-link-button {
    flex: 1;
    min-height: 41px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    background: rgba(255,255,255,.018);
    color: #cbbfd0;
    text-decoration: none;
    font: inherit;
    font-size: .61rem;
    font-weight: 750;
    cursor: pointer;
}

.account-link-button.danger {
    color: #e9a1b6;
    border-color: rgba(211, 69, 108, .14);
}

@media (max-width: 700px) {
    .account-chip-button {
        max-width: 150px;
    }

    .account-panel {
        width: 100vw;
        height: 100dvh;
        max-width: none;
        max-height: none;
        border: 0;
        border-radius: 0;
    }

    .account-overlay {
        padding: 0;
    }

    .account-panel-head {
        padding-top: max(14px, env(safe-area-inset-top));
    }

    .account-panel-body {
        padding-bottom: max(18px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 430px) {
    .account-copy small {
        display: none;
    }

    .account-chip-button {
        max-width: 126px;
        padding-right: 7px;
    }

    .account-bottom-actions {
        flex-direction: column;
    }
}


/* v5.0.14 – Statistik zeigt lange Inhalte vollständig */
.admin-live-panel h3,
#adminCurrentTitle,
.history-title,
.history-file,
.user-stat-now strong,
.user-stat-footer strong,
.pretty-history-panel .history-table td,
.pretty-days-panel .history-table td {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    max-width: none !important;
}

.user-stat-now strong {
    display: block !important;
    min-height: 0 !important;
    line-height: 1.35 !important;
}

.admin-live-panel h3,
#adminCurrentTitle {
    display: block !important;
    line-height: 1.35 !important;
    max-height: none !important;
}

.history-title {
    display: block !important;
    line-height: 1.38 !important;
}

.history-file {
    display: block !important;
    line-height: 1.35 !important;
}

.detailed-history-table td:nth-child(2) {
    min-width: 260px;
    width: auto;
}

.history-table td {
    vertical-align: top;
}

@media (min-width: 701px) {
    .pretty-history-panel .history-table-wrap {
        overflow-x: auto;
    }

    .pretty-history-panel .history-table {
        min-width: 920px;
        table-layout: auto;
    }

    .pretty-history-panel .history-table th:nth-child(1),
    .pretty-history-panel .history-table td:nth-child(1) {
        width: 145px;
    }

    .pretty-history-panel .history-table th:nth-child(2),
    .pretty-history-panel .history-table td:nth-child(2) {
        width: auto;
        min-width: 280px;
    }

    .pretty-history-panel .history-table th:nth-child(3),
    .pretty-history-panel .history-table td:nth-child(3) {
        width: 120px;
    }

    .pretty-history-panel .history-table th:nth-child(4),
    .pretty-history-panel .history-table td:nth-child(4) {
        width: 120px;
    }

    .pretty-history-panel .history-table th:nth-child(5),
    .pretty-history-panel .history-table td:nth-child(5) {
        width: 170px;
    }
}

@media (max-width: 700px) {
    .pretty-history-panel .history-title,
    .pretty-history-panel .history-file,
    .pretty-history-panel .history-table td,
    .pretty-days-panel .history-table td {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }

    .pretty-history-panel .history-table td,
    .pretty-days-panel .history-table td {
        min-height: 0 !important;
        line-height: 1.4 !important;
    }

    .user-stat-now strong {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        line-height: 1.35 !important;
    }

    .user-stat-card {
        min-width: 0 !important;
    }
}


/* v5.0.14 – Titelhistorie auf Smartphone vollständig innerhalb des Displays */
@media (max-width: 700px) {

    .pretty-history-panel,
    .pretty-history-panel .history-table-wrap,
    .pretty-history-panel .history-table,
    .pretty-history-panel .history-table tbody,
    .pretty-history-panel .history-table tr,
    .pretty-history-panel .history-table td {
        box-sizing: border-box !important;
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .pretty-history-panel {
        overflow: hidden !important;
    }

    .pretty-history-panel .history-table-wrap {
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }

    .pretty-history-panel .history-table {
        display: block !important;
        table-layout: fixed !important;
        margin: 0 !important;
    }

    .pretty-history-panel .history-table tbody {
        display: block !important;
    }

    .pretty-history-panel .history-table tr {
        display: grid !important;
        grid-template-columns: minmax(88px, 34%) minmax(0, 1fr) !important;
        column-gap: 10px !important;
        row-gap: 0 !important;

        margin: 0 0 9px !important;
        padding: 10px 11px !important;

        border: 1px solid rgba(255,255,255,.045) !important;
        border-radius: 14px !important;
        background: rgba(255,255,255,.016) !important;
        overflow: hidden !important;
    }

    .pretty-history-panel .history-table td {
        display: contents !important;
        padding: 0 !important;
        border: 0 !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    /* Label links */
    .pretty-history-panel .history-table td::before {
        position: static !important;
        display: block !important;
        width: auto !important;
        max-width: none !important;
        padding: 5px 0 !important;
        color: #746a79 !important;
        font-size: .53rem !important;
        font-weight: 800 !important;
        text-transform: uppercase !important;
        letter-spacing: .05em !important;
        line-height: 1.35 !important;
    }

    /* Wert rechts – bleibt garantiert in der Restbreite */
    .pretty-history-panel .history-title,
    .pretty-history-panel .history-file,
    .pretty-history-panel .state-pill {
        min-width: 0 !important;
        max-width: 100% !important;
        width: auto !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }

    /*
       Wegen display:contents liegt der eigentliche Textknoten ebenfalls
       im Grid. Damit jede Zelle sauber Label + Wert belegt, bekommt jeder
       Zellinhalt eine feste Grid-Spalte über die vorhandenen Elemente.
    */
    .pretty-history-panel .history-table td:nth-child(1)::before,
    .pretty-history-panel .history-table td:nth-child(2)::before,
    .pretty-history-panel .history-table td:nth-child(3)::before,
    .pretty-history-panel .history-table td:nth-child(4)::before,
    .pretty-history-panel .history-table td:nth-child(5)::before {
        grid-column: 1 !important;
    }

    /* Der Wert einer Zelle wird über td wieder als Grid-Container geführt */
    .pretty-history-panel .history-table td {
        grid-column: 1 / -1 !important;
    }

    /* Sauberere Lösung: jede Zelle als eigenes 2-Spalten-Grid */
    .pretty-history-panel .history-table tr {
        display: block !important;
    }

    .pretty-history-panel .history-table td {
        display: grid !important;
        grid-template-columns: minmax(88px, 34%) minmax(0, 1fr) !important;
        column-gap: 10px !important;
        align-items: start !important;
        width: 100% !important;
        padding: 5px 0 !important;
        min-height: 0 !important;
    }

    .pretty-history-panel .history-table td::before {
        grid-column: 1 !important;
        grid-row: 1 !important;
        padding: 0 !important;
    }

    .pretty-history-panel .history-table td > * {
        grid-column: 2 !important;
        grid-row: 1 !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    /* Falls ein Tabellenwert nur Textknoten enthält, verhindern wir die alte
       43%-Einrückung endgültig. */
    .pretty-history-panel .history-table td {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .pretty-history-panel .history-table td:nth-child(1)::before { content: "Beginn"; }
    .pretty-history-panel .history-table td:nth-child(2)::before { content: "Titel"; }
    .pretty-history-panel .history-table td:nth-child(3)::before { content: "Gehört"; }
    .pretty-history-panel .history-table td:nth-child(4)::before { content: "Status"; }
    .pretty-history-panel .history-table td:nth-child(5)::before { content: "Letzte Aktivität"; }

    .pretty-history-panel .history-title,
    .pretty-history-panel .history-file {
        display: block !important;
        line-height: 1.38 !important;
    }

    .pretty-history-panel .history-file {
        margin-top: 3px !important;
        opacity: .72;
    }
}

/* Noch schmalere Displays */
@media (max-width: 430px) {
    .pretty-history-panel .history-table td {
        grid-template-columns: minmax(78px, 31%) minmax(0, 1fr) !important;
        column-gap: 8px !important;
    }
}


/* v5.0.14 – Smartphone: Tagesspruch UND Stundenspruch immer sichtbar */
@media (max-width: 860px) {
    .quote-zone {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 9px !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .quote-zone .quote-card,
    .quote-zone .daily-quote,
    .quote-zone .hourly-quote {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 !important;
        overflow: visible !important;
        transform: none !important;
    }

    .quote-zone .quote-label,
    .quote-zone .quote-card p,
    #dailyQuote,
    #hourlyQuote {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        max-height: none !important;
        overflow: visible !important;
        white-space: normal !important;
        text-overflow: clip !important;
        overflow-wrap: anywhere !important;
    }

    .quote-zone .hourly-quote {
        order: 2 !important;
    }

    .quote-zone .daily-quote {
        order: 1 !important;
    }
}

@media (max-width: 430px) {
    .quote-zone {
        gap: 7px !important;
    }

    .quote-zone .quote-card {
        padding: 11px 12px !important;
        border-radius: 14px !important;
    }

    .quote-zone .quote-card p {
        line-height: 1.35 !important;
    }
}


/* v5.0.14 – Über diesen Player / Widmung */
.brand-button {
    appearance: none;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.brand-button:hover .brand-mark,
.brand-button:focus-visible .brand-mark {
    border-color: rgba(204, 128, 253, .34);
    box-shadow:
        inset 0 1px rgba(255,255,255,.06),
        0 0 0 3px rgba(145, 51, 190, .07),
        0 12px 30px rgba(63, 14, 82, .24);
}

.brand-button:focus-visible {
    outline: none;
}

.brand-button .brand-text h1 {
    transition: color .14s ease;
}

.brand-button:hover .brand-text h1,
.brand-button:focus-visible .brand-text h1 {
    color: #ffffff;
}

body.about-overlay-open {
    overflow: hidden !important;
}

.about-overlay {
    position: fixed;
    inset: 0;
    z-index: 7800;
    display: grid;
    place-items: center;
    padding: 18px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}

.about-overlay[hidden] {
    display: none !important;
}

.about-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.about-overlay-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 14% 8%, rgba(138, 48, 184, .17), transparent 34%),
        radial-gradient(circle at 84% 88%, rgba(120, 9, 56, .19), transparent 36%),
        rgba(4, 3, 6, .89);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.about-panel {
    position: relative;
    z-index: 1;
    width: min(620px, 96vw);
    max-height: min(860px, 94vh);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border: 1px solid rgba(201, 126, 251, .18);
    border-radius: 25px;
    background:
        radial-gradient(circle at 100% 0%, rgba(145, 50, 191, .14), transparent 32%),
        radial-gradient(circle at 0% 100%, rgba(124, 10, 58, .11), transparent 34%),
        linear-gradient(150deg, rgba(28, 16, 34, .995), rgba(9, 6, 12, .998));
    box-shadow:
        0 36px 120px rgba(0,0,0,.72),
        inset 0 1px rgba(255,255,255,.025);
    transform: translateY(10px) scale(.992);
    transition: transform .15s ease;
}

.about-overlay.is-open .about-panel {
    transform: translateY(0) scale(1);
}

.about-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 17px 15px;
    border-bottom: 1px solid rgba(255,255,255,.045);
}

.about-title-wrap {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.about-mark {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    border: 1px solid rgba(205, 137, 255, .25);
    background:
        linear-gradient(145deg, rgba(155, 62, 207, .63), rgba(134, 18, 72, .58));
    color: #fff;
    font-size: .95rem;
    font-weight: 900;
    box-shadow: 0 10px 26px rgba(71, 16, 91, .24);
}

.about-title-wrap h2 {
    margin: 2px 0 0;
    color: #f6edf9;
    font-size: 1.08rem;
}

.about-panel-close {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.065);
    border-radius: 13px;
    background: rgba(255,255,255,.022);
    color: #eadfed;
    font-size: 1.2rem;
    cursor: pointer;
}

.about-panel-body {
    overflow: auto;
    padding: 18px;
}

.about-created-by {
    display: grid;
    gap: 4px;
    margin-bottom: 17px;
    padding: 12px 13px;
    border: 1px solid rgba(197, 119, 247, .12);
    border-radius: 14px;
    background: rgba(151, 55, 198, .055);
}

.about-created-by span,
.about-dedication-label {
    color: #9a7bad;
    font-size: .53rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.about-created-by strong {
    color: #eee3f3;
    font-size: .74rem;
    font-weight: 800;
}

.about-copy {
    margin: 0 0 13px;
    color: #b9adbF;
    font-size: .70rem;
    line-height: 1.62;
}

.about-dedication {
    position: relative;
    margin-top: 18px;
    padding: 17px 17px 18px;
    overflow: hidden;
    border: 1px solid rgba(210, 125, 171, .13);
    border-radius: 18px;
    background:
        radial-gradient(circle at 92% 10%, rgba(163, 63, 111, .12), transparent 38%),
        linear-gradient(145deg, rgba(116, 21, 62, .12), rgba(88, 24, 99, .08));
}

.about-dedication::after {
    content: "♪";
    position: absolute;
    right: 15px;
    bottom: 7px;
    color: rgba(223, 147, 190, .10);
    font-size: 3.2rem;
    line-height: 1;
    pointer-events: none;
}

.about-dedication p {
    position: relative;
    z-index: 1;
    margin: 9px 0 0;
    color: #eadfe7;
    font-size: .76rem;
    line-height: 1.66;
}

.about-signature {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 7px;
    margin-top: 19px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.04);
    color: #7e7283;
    font-size: .58rem;
}

.about-signature strong {
    color: #bcaec3;
    font-weight: 800;
}

.about-signature small {
    color: #675d6b;
    font-size: .52rem;
}

@media (max-width: 700px) {
    .about-overlay {
        padding: 0;
    }

    .about-panel {
        width: 100vw;
        height: 100dvh;
        max-width: none;
        max-height: none;
        border: 0;
        border-radius: 0;
    }

    .about-panel-head {
        padding-top: max(14px, env(safe-area-inset-top));
    }

    .about-panel-body {
        padding: 16px 15px max(20px, env(safe-area-inset-bottom));
    }

    .about-copy {
        font-size: .72rem;
    }

    .about-dedication p {
        font-size: .77rem;
    }
}

@media (max-width: 430px) {
    .about-mark {
        width: 43px;
        height: 43px;
        border-radius: 14px;
    }

    .about-panel-head {
        padding-left: 14px;
        padding-right: 12px;
    }

    .about-dedication {
        padding: 15px;
    }
}


/* v5.0.14 – Spruchfarben wieder wie in v4 eindeutig getrennt */
.daily-quote {
    position: relative;
    background:
        radial-gradient(circle at 100% 100%, rgba(158, 83, 215, .10), transparent 38%),
        linear-gradient(145deg, rgba(35,20,43,.68), rgba(16,9,20,.70)) !important;
}

.hourly-quote {
    position: relative;
    background:
        radial-gradient(circle at 100% 100%, rgba(214, 74, 128, .10), transparent 38%),
        linear-gradient(145deg, rgba(41,12,27,.64), rgba(17,8,17,.72)) !important;
}

/* Tagesspruch = violett */
.daily-quote .quote-label {
    color: #b98ad7 !important;
}

/* Stundenspruch = pink/rosé – exakt die klare v4-Trennung */
.hourly-quote .quote-label {
    color: #ff99bd !important;
}

/* kleine Farbkante macht die Zuordnung zusätzlich sofort sichtbar */
.daily-quote::before,
.hourly-quote::before {
    content: "";
    position: absolute;
    left: 0;
    top: 13px;
    bottom: 13px;
    width: 2px;
    border-radius: 999px;
    pointer-events: none;
}

.daily-quote::before {
    background: #b98ad7;
    box-shadow: 0 0 12px rgba(185, 138, 215, .22);
}

.hourly-quote::before {
    background: #ff99bd;
    box-shadow: 0 0 12px rgba(255, 153, 189, .20);
}

/* v4 hatte zusätzlich unterschiedliche Lichtakzente */
.daily-quote::after {
    background: rgba(166, 92, 221, .42) !important;
}

.hourly-quote::after {
    background: rgba(218, 70, 126, .42) !important;
}

@media (max-width: 860px) {
    .daily-quote .quote-label {
        color: #b98ad7 !important;
    }

    .hourly-quote .quote-label {
        color: #ff99bd !important;
    }

    .daily-quote::before,
    .hourly-quote::before {
        top: 10px;
        bottom: 10px;
    }
}
