:root {
    color-scheme: light;
    --sidebar-w: 17.5rem;
    --brand: #6366f1;
    --brand-2: #8b5cf6;
    --surface: rgba(255, 255, 255, .88);
    --surface-solid: #fff;
    --border: rgba(15, 23, 42, .08);
    --shadow: 0 18px 50px rgba(15, 23, 42, .08);
}

html.dark {
    color-scheme: dark;
    --surface: rgba(15, 20, 35, .88);
    --surface-solid: #0f1423;
    --border: rgba(255, 255, 255, .07);
    --shadow: 0 20px 55px rgba(0, 0, 0, .24);
}

@font-face {
    font-family: "YekanBakhFaNumLocal";
    src: url("../font/woff2/YekanBakhFaNum-Regular.woff2") format("woff2"),
         url("../font/woff/YekanBakhFaNum-Regular.woff") format("woff");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

html { scroll-behavior: smooth; }
body {
    font-family: "Segoe UI", Roboto, Arial, ui-sans-serif, system-ui, -apple-system, sans-serif;
    font-weight: 400;
    overflow-x: hidden;
}
html[lang="fa"] body,
html[lang="fa"] button,
html[lang="fa"] input,
html[lang="fa"] select,
html[lang="fa"] textarea {
    font-family: "YekanBakhFaNumLocal", Tahoma, Arial, sans-serif;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { user-select: none; }

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .32); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, .58); }

.rhythm-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(circle at 12% 4%, rgba(99, 102, 241, .10), transparent 28rem),
        radial-gradient(circle at 88% 12%, rgba(139, 92, 246, .08), transparent 25rem),
        linear-gradient(180deg, rgba(255,255,255,.25), transparent 18rem);
}
.dark .rhythm-bg {
    background:
        radial-gradient(circle at 10% 5%, rgba(99, 102, 241, .10), transparent 30rem),
        radial-gradient(circle at 92% 18%, rgba(168, 85, 247, .07), transparent 25rem);
}

/* Shell */
.app-sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 60;
    width: var(--sidebar-w);
    background: rgba(255,255,255,.92);
    border-inline-end: 1px solid var(--border);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transform: translateX(-103%);
    transition: transform .28s cubic-bezier(.2,.8,.2,1), background-color .2s ease;
    box-shadow: 10px 0 40px rgba(15,23,42,.06);
}
[dir="rtl"] .app-sidebar { transform: translateX(103%); }
.dark .app-sidebar { background: rgba(10, 14, 25, .94); box-shadow: 10px 0 40px rgba(0,0,0,.18); }
body.sidebar-open .app-sidebar { transform: translateX(0); }

.app-main { min-width: 0; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(248, 250, 252, .76);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}
.dark .topbar { background: rgba(8, 12, 22, .76); }

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(2, 6, 23, .52);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
    backdrop-filter: blur(3px);
}
body.sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; pointer-events: auto; }

@media (min-width: 1024px) {
    .app-sidebar { transform: translateX(0) !important; }
    .app-main { margin-inline-start: var(--sidebar-w); }
    .sidebar-overlay { display: none; }
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    flex: 0 0 auto;
    border-radius: .95rem;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #8b5cf6 60%, #a855f7);
    box-shadow: 0 10px 24px rgba(99,102,241,.28), inset 0 1px 0 rgba(255,255,255,.26);
}

.sidebar-scroll { scrollbar-width: thin; }
.sidebar-label {
    margin: .7rem .7rem .55rem;
    font-size: .66rem;
    line-height: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .15em;
    color: #94a3b8;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 2.9rem;
    margin-bottom: .2rem;
    padding: .65rem .8rem;
    border-radius: .9rem;
    color: #64748b;
    font-size: .85rem;
    font-weight: 700;
    transition: color .18s ease, background-color .18s ease, transform .18s ease;
}
.sidebar-link:hover { color: #3730a3; background: rgba(99,102,241,.07); transform: translateX(2px); }
[dir="rtl"] .sidebar-link:hover { transform: translateX(-2px); }
.dark .sidebar-link { color: #94a3b8; }
.dark .sidebar-link:hover { color: #c7d2fe; background: rgba(99,102,241,.11); }
.sidebar-link.active {
    color: #4338ca;
    background: linear-gradient(135deg, rgba(99,102,241,.13), rgba(139,92,246,.08));
    box-shadow: inset 0 0 0 1px rgba(99,102,241,.08);
}
.dark .sidebar-link.active { color: #c7d2fe; background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(139,92,246,.10)); }
.sidebar-link.compact { min-height: 2.55rem; font-weight: 650; }
.sidebar-icon { display: grid; place-items: center; width: 1.65rem; height: 1.65rem; flex: 0 0 auto; font-size: .92rem; color: #94a3b8; }
.sidebar-link.active .sidebar-icon, .sidebar-link:hover .sidebar-icon { color: currentColor; }

.user-panel {
    display: flex;
    align-items: center;
    gap: .6rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: .65rem;
    background: rgba(248,250,252,.75);
}
.dark .user-panel { background: rgba(255,255,255,.035); }

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 2.55rem;
    height: 2.55rem;
    flex: 0 0 auto;
    border-radius: .85rem;
    color: #64748b;
    transition: color .16s ease, background-color .16s ease, transform .16s ease;
}
.icon-button:hover { color: #4338ca; background: rgba(99,102,241,.08); }
.icon-button:active { transform: scale(.94); }
.dark .icon-button { color: #94a3b8; }
.dark .icon-button:hover { color: #e0e7ff; background: rgba(99,102,241,.11); }

.top-search {
    width: 100%;
    height: 2.8rem;
    padding-inline: 2.7rem 3rem;
    border: 1px solid rgba(148,163,184,.18);
    border-radius: .95rem;
    background: rgba(255,255,255,.76);
    color: #0f172a;
    outline: none;
    font-size: .83rem;
    font-weight: 600;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.top-search::placeholder { color: #94a3b8; font-weight: 500; }
.top-search:focus { background: #fff; border-color: rgba(99,102,241,.5); box-shadow: 0 0 0 4px rgba(99,102,241,.10); }
.dark .top-search { background: rgba(255,255,255,.035); border-color: rgba(255,255,255,.07); color: #f8fafc; }
.dark .top-search:focus { background: rgba(255,255,255,.055); border-color: rgba(129,140,248,.42); }

/* Loading */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: #090d18;
    color: rgba(255,255,255,.55);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .15em;
    text-transform: uppercase;
    opacity: 1;
    visibility: visible;
    transition: opacity .32s ease, visibility .32s ease;
}
.loading-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-mark {
    display: grid;
    place-items: center;
    width: 3.8rem;
    height: 3.8rem;
    border-radius: 1.35rem;
    color: #fff;
    font-size: 1.4rem;
    background: linear-gradient(135deg, #4f46e5, #8b5cf6);
    box-shadow: 0 0 0 0 rgba(99,102,241,.35);
    animation: loadingPulse 1.35s infinite;
}
@keyframes loadingPulse { 0% { box-shadow: 0 0 0 0 rgba(99,102,241,.35); } 70% { box-shadow: 0 0 0 18px rgba(99,102,241,0); } 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); } }

/* Generic surfaces/buttons */
.surface-card {
    border: 1px solid var(--border);
    border-radius: 1.35rem;
    background: var(--surface);
    box-shadow: 0 8px 30px rgba(15,23,42,.035);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.dark .surface-card { box-shadow: none; }

.btn-primary, .btn-secondary, .section-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    border-radius: .9rem;
    font-size: .82rem;
    font-weight: 800;
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, color .16s ease;
}
.btn-primary { min-height: 2.75rem; padding: .7rem 1rem; color: #fff; background: linear-gradient(135deg, #4f46e5, #7c3aed); box-shadow: 0 10px 24px rgba(99,102,241,.23); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(99,102,241,.30); }
.btn-secondary { min-height: 2.75rem; padding: .7rem 1rem; color: #475569; background: rgba(255,255,255,.75); border: 1px solid rgba(148,163,184,.20); }
.btn-secondary:hover { color: #4338ca; background: #fff; }
.dark .btn-secondary { color: #cbd5e1; background: rgba(255,255,255,.045); border-color: rgba(255,255,255,.08); }
.dark .btn-secondary:hover { color: #fff; background: rgba(255,255,255,.07); }

/* Dashboard */
.dashboard-hero {
    position: relative;
    background:
        radial-gradient(circle at 82% 24%, rgba(139,92,246,.16), transparent 16rem),
        radial-gradient(circle at 12% 90%, rgba(99,102,241,.10), transparent 18rem),
        linear-gradient(135deg, rgba(255,255,255,.92), rgba(248,250,252,.84));
}
.dashboard-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .32;
    background-image: radial-gradient(rgba(99,102,241,.18) .75px, transparent .75px);
    background-size: 16px 16px;
    mask-image: linear-gradient(to right, transparent, black 62%);
}
.dark .dashboard-hero {
    background:
        radial-gradient(circle at 82% 24%, rgba(124,58,237,.18), transparent 17rem),
        radial-gradient(circle at 12% 90%, rgba(99,102,241,.12), transparent 18rem),
        linear-gradient(135deg, rgba(17,24,39,.92), rgba(9,13,24,.88));
}

.hero-visual { position: relative; min-height: 13rem; }
.hero-disc {
    position: absolute;
    top: 50%;
    right: 6%;
    width: 11.5rem;
    height: 11.5rem;
    transform: translateY(-54%);
    border-radius: 50%;
    background: repeating-radial-gradient(circle at center, #151827 0 7px, #212536 8px 10px, #11131f 11px 17px);
    box-shadow: 0 32px 55px rgba(15,23,42,.25);
    animation: slowSpin 16s linear infinite;
}
[dir="rtl"] .hero-disc { right: auto; left: 6%; }
.hero-disc-ring { position: absolute; inset: 29%; border-radius: 50%; border: 1px solid rgba(255,255,255,.13); background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.hero-disc-center { position: absolute; inset: 40%; display: grid; place-items: center; border-radius: 50%; background: #f8fafc; color: #4f46e5; font-size: .85rem; }
.hero-wave { position: absolute; z-index: 2; left: 0; right: 0; bottom: 8%; display: flex; height: 3.8rem; align-items: center; justify-content: center; gap: .32rem; }
.hero-wave span { display: block; width: .25rem; min-height: .7rem; border-radius: 999px; background: linear-gradient(to top, #6366f1, #a78bfa); box-shadow: 0 0 12px rgba(99,102,241,.15); animation: wave 1.3s ease-in-out infinite alternate; }
.hero-wave span:nth-child(3n+1) { animation-delay: -.45s; }
.hero-wave span:nth-child(3n+2) { animation-delay: -.8s; }
@keyframes slowSpin { to { transform: translateY(-54%) rotate(360deg); } }
@keyframes wave { from { transform: scaleY(.66); opacity: .72; } to { transform: scaleY(1.08); opacity: 1; } }

.stat-card {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-width: 0;
    min-height: 6rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 1.2rem;
    background: var(--surface);
    box-shadow: 0 8px 28px rgba(15,23,42,.03);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.stat-card:hover { transform: translateY(-2px); border-color: rgba(99,102,241,.14); box-shadow: 0 16px 35px rgba(15,23,42,.065); }
.dark .stat-card:hover { box-shadow: none; }
.stat-icon { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; flex: 0 0 auto; border-radius: 1rem; font-size: 1rem; }

.meta-pill { display: inline-flex; align-items: center; gap: .4rem; border-radius: .7rem; padding: .4rem .55rem; background: #f8fafc; }
.dark .meta-pill { background: rgba(255,255,255,.04); }
.quick-action { display: flex; min-height: 4.4rem; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: .55rem; border: 1px solid var(--border); border-radius: 1rem; padding: .8rem; color: #475569; background: rgba(248,250,252,.72); font-size: .72rem; font-weight: 800; transition: all .18s ease; }
.quick-action i { color: #6366f1; font-size: 1rem; }
.quick-action:hover { color: #3730a3; border-color: rgba(99,102,241,.18); background: rgba(99,102,241,.06); transform: translateY(-1px); }
.dark .quick-action { color: #cbd5e1; background: rgba(255,255,255,.025); }
.dark .quick-action:hover { color: #fff; background: rgba(99,102,241,.09); }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-heading h2 { margin-top: .15rem; font-size: 1.35rem; line-height: 1.8rem; font-weight: 900; letter-spacing: -.025em; color: #0f172a; }
.dark .section-heading h2 { color: #fff; }
.section-kicker { font-size: .64rem; font-weight: 900; text-transform: uppercase; letter-spacing: .16em; color: #94a3b8; }
.section-action { flex: 0 0 auto; min-height: 2.35rem; padding: .55rem .8rem; color: #4f46e5; background: rgba(99,102,241,.07); }
.section-action:hover { background: rgba(99,102,241,.12); transform: translateY(-1px); }
.dark .section-action { color: #c7d2fe; background: rgba(99,102,241,.10); }

.music-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .8rem; }
@media (min-width: 640px) { .music-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; } }
@media (min-width: 1280px) { .music-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (min-width: 1536px) { .music-grid { grid-template-columns: repeat(5, minmax(0,1fr)); } }

.music-tile {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    background: var(--surface);
    box-shadow: 0 8px 28px rgba(15,23,42,.035);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.music-tile:hover { transform: translateY(-4px); border-color: rgba(99,102,241,.14); box-shadow: 0 20px 42px rgba(15,23,42,.085); }
.dark .music-tile:hover { box-shadow: 0 20px 42px rgba(0,0,0,.16); }
.music-cover-wrap { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: #f1f5f9; }
.dark .music-cover-wrap { background: #171d2d; }
.music-cover { width: 100%; height: 100%; object-fit: cover; transition: transform .45s cubic-bezier(.2,.8,.2,1), filter .3s ease; }
.music-tile:hover .music-cover { transform: scale(1.055); }
.music-cover-gradient { position: absolute; inset: 0; background: linear-gradient(to top, rgba(2,6,23,.62), transparent 54%); opacity: .72; }
.music-play { position: absolute; right: .75rem; bottom: .75rem; display: grid; width: 2.75rem; height: 2.75rem; place-items: center; border-radius: 50%; color: #0f172a; background: #fff; box-shadow: 0 12px 25px rgba(2,6,23,.28); transition: transform .18s ease, opacity .18s ease; }
[dir="rtl"] .music-play { right: auto; left: .75rem; }
.music-play:hover { transform: scale(1.08); }
@media (hover:hover) { .music-play { opacity: 0; transform: translateY(6px); } .music-tile:hover .music-play { opacity: 1; transform: translateY(0); } }
.cover-badge, .cover-count { display: inline-flex; align-items: center; gap: .3rem; border-radius: .55rem; color: #fff; background: rgba(2,6,23,.56); backdrop-filter: blur(8px); font-size: .62rem; font-weight: 800; }
.cover-badge { padding: .36rem .48rem; }
.cover-count { position: absolute; left: .7rem; bottom: .75rem; padding: .3rem .5rem; }
[dir="rtl"] .cover-count { left: auto; right: .7rem; }
.tile-action { display: grid; width: 2rem; height: 2rem; flex: 0 0 auto; place-items: center; border-radius: .7rem; color: #94a3b8; font-size: .75rem; transition: all .16s ease; }
.tile-action:hover { color: #4f46e5; background: rgba(99,102,241,.08); }

.playlist-card { display: flex; min-width: 0; align-items: center; gap: .85rem; border: 1px solid var(--border); border-radius: 1.15rem; padding: .8rem; background: var(--surface); transition: all .18s ease; }
.playlist-card:hover { transform: translateY(-2px); border-color: rgba(99,102,241,.15); box-shadow: 0 14px 30px rgba(15,23,42,.055); }
.dark .playlist-card:hover { box-shadow: none; }
.playlist-art { display: grid; width: 3.4rem; height: 3.4rem; flex: 0 0 auto; place-items: center; border-radius: 1rem; color: #6366f1; background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(168,85,247,.08)); font-size: 1.2rem; }

.public-card { min-width: 0; }
.horizontal-scroll { scrollbar-width: none; scroll-snap-type: x proximity; }
.horizontal-scroll::-webkit-scrollbar { display: none; }
.horizontal-scroll > * { scroll-snap-align: start; }

.empty-state { display: flex; min-height: 18rem; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed rgba(148,163,184,.28); border-radius: 1.35rem; padding: 2rem; text-align: center; background: rgba(255,255,255,.52); }
.dark .empty-state { background: rgba(255,255,255,.018); }
.empty-icon { display: grid; width: 4rem; height: 4rem; place-items: center; border-radius: 1.4rem; color: #6366f1; background: rgba(99,102,241,.09); font-size: 1.35rem; }
.empty-state h3 { margin-top: 1rem; font-size: 1rem; font-weight: 900; color: #334155; }
.dark .empty-state h3 { color: #e2e8f0; }
.empty-state p { max-width: 28rem; margin-top: .45rem; color: #94a3b8; font-size: .78rem; line-height: 1.5rem; }

/* Existing generic cards get a modern lift without touching every view */
.music-card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.music-card:hover { transform: translateY(-3px); box-shadow: 0 18px 36px rgba(15,23,42,.08); border-color: rgba(99,102,241,.15); }
.dark .music-card:hover { box-shadow: 0 18px 36px rgba(0,0,0,.18); }

/* Mobile nav */
.mobile-nav {
    position: fixed;
    left: .7rem;
    right: .7rem;
    bottom: max(.65rem, env(safe-area-inset-bottom));
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(5, minmax(0,1fr));
    height: 4rem;
    padding: .35rem .45rem;
    border: 1px solid var(--border);
    border-radius: 1.35rem;
    background: rgba(255,255,255,.92);
    box-shadow: 0 18px 45px rgba(15,23,42,.17);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.dark .mobile-nav { background: rgba(15,20,35,.94); box-shadow: 0 18px 45px rgba(0,0,0,.35); }
.mobile-nav-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .24rem; border-radius: .9rem; color: #94a3b8; font-size: .92rem; transition: all .18s ease; }
.mobile-nav-link span { max-width: 4.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .55rem; font-weight: 800; }
.mobile-nav-link.active { color: #4f46e5; background: rgba(99,102,241,.08); }
.dark .mobile-nav-link.active { color: #c7d2fe; background: rgba(99,102,241,.12); }
.mobile-upload { display: grid; width: 3.15rem; height: 3.15rem; place-items: center; align-self: center; justify-self: center; border-radius: 1.05rem; color: white; background: linear-gradient(135deg,#4f46e5,#8b5cf6); box-shadow: 0 10px 24px rgba(99,102,241,.30); transform: translateY(-.55rem); }

/* Player */
.mini-player {
    position: fixed;
    z-index: 65;
    inset-inline: .7rem;
    bottom: calc(max(.65rem, env(safe-area-inset-bottom)) + 4.45rem);
    transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .22s ease;
}
.mini-player.hidden-player { transform: translateY(125%); opacity: 0; pointer-events: none; }
.mini-player-inner { display: flex; align-items: center; gap: .7rem; max-width: 74rem; margin: 0 auto; padding: .62rem; border: 1px solid var(--border); border-radius: 1.2rem; background: rgba(255,255,255,.94); box-shadow: 0 20px 50px rgba(15,23,42,.17); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
.dark .mini-player-inner { background: rgba(15,20,35,.95); box-shadow: 0 20px 50px rgba(0,0,0,.32); }
.player-control { display: grid; width: 2.25rem; height: 2.25rem; place-items: center; border-radius: .8rem; font-size: .8rem; transition: transform .15s ease, background-color .15s ease, color .15s ease; }
.player-control:active { transform: scale(.93); }
.player-control.secondary { color: #64748b; }
.player-control.secondary:hover { color: #4f46e5; background: rgba(99,102,241,.08); }
.dark .player-control.secondary { color: #94a3b8; }
.player-control.primary { width: 2.45rem; height: 2.45rem; border-radius: .9rem; color: #fff; background: linear-gradient(135deg,#4f46e5,#7c3aed); box-shadow: 0 8px 18px rgba(99,102,241,.25); }
.player-range { height: .25rem; border-radius: 999px; accent-color: #6366f1; cursor: pointer; }

@media (min-width: 1024px) {
    .mini-player { inset-inline-start: calc(var(--sidebar-w) + 1rem); inset-inline-end: 1rem; bottom: 1rem; }
    .mobile-nav { display: none; }
}

/* Keep content clear of mini-player when active */
body.player-open .page-content { padding-bottom: 9rem; }
@media (min-width: 1024px) { body.player-open .page-content { padding-bottom: 7.5rem; } }

/* Page transitions */
.page-content { transition: opacity .18s ease, transform .18s ease; }
.page-content.transitioning { opacity: .45; transform: translateY(3px); }

/* Utility fixes for RTL and touch */
[dir="rtl"] .fa-arrow-right-from-bracket { transform: rotate(180deg); }
.safe-area-bottom { padding-bottom: env(safe-area-inset-bottom); }

/* Native audio controls */
audio { color-scheme: light dark; }

@media (max-width: 420px) {
    .section-heading h2 { font-size: 1.15rem; }
    .section-action { min-height: 2.15rem; padding: .48rem .62rem; font-size: .7rem; }
    .stat-card { min-height: 5.5rem; padding: .8rem; gap: .65rem; }
    .stat-icon { width: 2.4rem; height: 2.4rem; border-radius: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
