:root {
    --primary: #ff6b35;
    --primary-dark: #e55a28;
    --bg: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-hover: #252525;
    --text: #ffffff;
    --text-muted: #999;
    --border: #333;
    --success: #4caf50;
    --warning: #ff9800;
    --danger: #f44336;
    --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    background-image: radial-gradient(ellipse at top, #1f1208 0%, var(--bg) 55%);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

.hidden { display: none !important; }

/* LOGIN */
.login-card {
    max-width: 400px;
    margin: 60px auto;
    padding: 40px 30px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    text-align: center;
}

.logo { margin-bottom: 10px; }
.sm-logo-login {
    width: min(140px, 55vw);
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto 10px;
}
.header-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.login-card h1 { color: var(--primary); font-size: 1.6rem; margin-bottom: 5px; }
.subtitle { color: var(--text-muted); margin-bottom: 25px; font-size: 0.9rem; }

.tabs { display: flex; gap: 0; margin-bottom: 20px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.tab { flex: 1; padding: 10px; background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.95rem; }
.tab.active { background: var(--primary); color: #fff; font-weight: 600; }

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form input {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
}
.auth-form input:focus { outline: none; border-color: var(--primary); }

.trial-info { color: var(--success); font-size: 0.85rem; margin-top: 5px; }
.error-msg { color: var(--danger); margin-top: 15px; font-size: 0.9rem; }
.admin-login-link { margin-top: 20px; font-size: 0.8rem; text-align: center; }
.login-hint { margin-top: 12px; font-size: 0.75rem; color: var(--text-muted); text-align: center; line-height: 1.4; }
.admin-login-link a { color: var(--text-muted); text-decoration: none; }
.admin-login-link a:hover { color: var(--primary); }
.btn-admin { text-decoration: none; font-size: 1.1rem; }

.btn-primary {
    padding: 14px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-pulse { animation: btnPulse 2s ease-in-out infinite; }
@keyframes btnPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,107,53,0.4); } 50% { box-shadow: 0 0 0 12px rgba(255,107,53,0); } }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
    padding: 12px 18px;
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    font-size: 0.95rem;
    cursor: pointer;
}
.btn-secondary:hover { background: rgba(255,107,53,0.1); }

.btn-small { padding: 6px 12px; background: transparent; border: 1px solid var(--border); color: var(--text-muted); border-radius: 6px; cursor: pointer; font-size: 0.8rem; }
.btn-icon { background: transparent; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; padding: 8px; }

/* HEADER */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0,0,0,0.95);
    border-bottom: 1px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header h1 { font-size: 1.2rem; color: var(--primary); animation: shimmer 3s ease-in-out infinite; }
@keyframes shimmer { 0%,100% { opacity: 1; } 50% { opacity: 0.85; } }
.header-left { display: flex; align-items: center; gap: 10px; }
.plan-badge {
    background: var(--primary); color: #fff; padding: 2px 8px; border-radius: 12px;
    font-size: 0.7rem; font-weight: 600; cursor: pointer; border: none;
}
.plan-badge:hover { filter: brightness(1.1); }
.btn-plans-header {
    background: rgba(255,107,53,0.2);
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.btn-plans-header:hover { background: rgba(255,107,53,0.35); }
.help-card-plans { border-color: rgba(255,107,53,0.4); }
.user-name { color: var(--text-muted); font-size: 0.85rem; }

.subscription-banner {
    background: rgba(255,152,0,0.15);
    border-bottom: 1px solid var(--warning);
    padding: 12px 16px;
    text-align: center;
    color: var(--warning);
    font-size: 0.9rem;
}
.subscription-banner a { color: var(--primary); }
.subscribe-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 16px; background: rgba(255,107,53,0.12);
    border-bottom: 1px solid var(--border); font-size: 0.9rem;
}
.btn-plans { font-size: 1.1rem; }

/* PLANOS */
.plans-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.88);
    display: flex; align-items: center; justify-content: center;
    z-index: 950;
    padding: 16px;
}
.plans-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
}
.plans-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.plans-header h2 { font-size: 1.15rem; color: var(--primary); margin: 0; }
.plans-status { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; line-height: 1.4; }
.plans-test-badge {
    background: rgba(255,193,7,0.15);
    border: 1px solid #ffc107;
    color: #ffc107;
    font-size: 0.8rem;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: center;
}
.plans-grid { display: flex; flex-direction: column; gap: 12px; }
.plan-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    background: rgba(255,255,255,0.03);
    transition: border-color 0.2s;
}
.plan-card.featured { border-color: var(--primary); background: rgba(255,107,53,0.08); }
.plan-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.plan-card-head h3 { margin: 0; font-size: 1.05rem; color: #fff; }
.plan-desc { margin: 4px 0 0; font-size: 0.8rem; color: var(--text-muted); line-height: 1.3; }
.plan-price { font-size: 1.4rem; font-weight: 700; color: var(--primary); white-space: nowrap; }
.plan-price small { font-size: 0.75rem; font-weight: 400; color: var(--text-muted); }
.plan-features { list-style: none; margin: 0 0 14px; padding: 0; font-size: 0.85rem; color: #ccc; }
.plan-features li { padding: 4px 0; }
.plan-features li::before { content: '✓ '; color: var(--primary); }
.plan-card .btn-primary { width: 100%; }
.plans-footnote { margin-top: 16px; font-size: 0.75rem; color: var(--text-muted); text-align: center; line-height: 1.4; }
.plans-loading { text-align: center; padding: 24px; color: var(--text-muted); }
.plans-unavailable { text-align: center; padding: 20px; color: var(--text-muted); font-size: 0.9rem; }

/* PLAYER */
.player-section { background: #000; }
.player-stage { position: relative; max-width: 100%; height: 100%; display: flex; flex-direction: column; min-height: 0; }
.player-wrapper { position: relative; max-width: 100%; }
.player-video-wrap { position: relative; background: #000; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
#video-player { width: 100%; max-height: 50vh; background: #000; display: block; object-fit: contain; }

/* Modo palco — vídeo em cima, catálogo embaixo (PC + celular) */
:root { --sm-dock-height: 46vh; }

body.app-playing {
    overflow: hidden;
    height: 100dvh;
}

body.app-playing .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 950;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.88);
}

body.app-playing #player-section.player-stage-mode {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    height: calc(100dvh - 52px - var(--sm-dock-height));
    z-index: 900;
    display: flex !important;
    flex-direction: column;
    background: #000;
}

body.app-playing #player-section.player-stage-mode .player-stage {
    flex: 1;
    min-height: 0;
}

body.app-playing #player-section.player-stage-mode #video-player {
    width: 100%;
    height: 100%;
    max-height: none;
    flex: 1;
    object-fit: contain;
}

body.app-playing #player-section.player-stage-mode .player-controls {
    flex-shrink: 0;
}

body.app-playing #app-catalog {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--sm-dock-height);
    z-index: 910;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border-top: 2px solid var(--primary);
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

body.app-playing #app-catalog .help-guide { display: none !important; }

body.app-playing #app-catalog .code-bar {
    flex-shrink: 0;
    padding: 8px 12px;
    gap: 6px;
}

body.app-playing #app-catalog .search-container {
    flex-shrink: 0;
    padding: 6px 12px 4px;
}

body.app-playing #app-catalog .stats-row { display: none; }

body.app-playing #app-catalog #queue-panel {
    flex-shrink: 0;
    margin: 0 12px 6px;
    max-height: 88px;
}

body.app-playing #app-catalog #queue-panel .queue-list {
    max-height: 52px;
}

body.app-playing #app-catalog .songs-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 12px 10px;
    -webkit-overflow-scrolling: touch;
}

body.app-playing .song-item {
    padding: 10px;
    margin-bottom: 4px;
}

body.app-playing .song-actions .btn-add-queue {
    background: var(--primary) !important;
    color: #fff !important;
    font-weight: 700;
}

/* Navegação / catálogo — tela inicial mais limpa */
#app-screen {
    max-width: 900px;
    margin: 0 auto;
}

#app-catalog .help-guide {
    margin: 10px 12px;
}

#app-catalog .help-guide.collapsed .help-header h2 {
    font-size: 0.9rem;
}

.app-catalog .code-bar,
.app-catalog .search-container,
.app-catalog .songs-container {
    max-width: 100%;
}

/* Mobile / tablet — tela cheia ao tocar */
html.player-open,
body.player-open {
    overflow: hidden;
    height: 100%;
    position: fixed;
    width: 100%;
}

.player-section.player-mobile-mode {
    position: fixed !important;
    inset: 0;
    z-index: 900;
    display: flex !important;
    flex-direction: column;
    background: #000;
    padding:
        env(safe-area-inset-top, 0)
        env(safe-area-inset-right, 0)
        env(safe-area-inset-bottom, 0)
        env(safe-area-inset-left, 0);
    max-height: 100dvh;
    height: 100dvh;
}

.player-section.player-mobile-mode .player-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.player-section.player-mobile-mode .player-video-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.player-section.player-mobile-mode #video-player {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
}

/* Paisagem no celular */
@media (orientation: landscape) and (max-height: 500px) {
    .player-section.player-mobile-mode .player-video-wrap {
        flex: 1;
    }
    .player-section.player-mobile-mode .now-playing {
        font-size: 0.75rem;
        padding: 4px 12px;
    }
    .player-section.player-mobile-mode .player-controls {
        padding: 6px 12px;
    }
}

/* Retrato */
@media (orientation: portrait) and (max-width: 1024px) {
    .player-section.player-mobile-mode #video-player {
        max-height: calc(100dvh - 120px);
    }
}

.player-section.player-mobile-mode:fullscreen,
.player-section.player-mobile-mode:-webkit-full-screen {
    width: 100%;
    height: 100%;
}

.player-wrapper:fullscreen,
.player-wrapper:-webkit-full-screen {
    background: #000;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.player-wrapper:fullscreen #video-player,
.player-wrapper:-webkit-full-screen #video-player {
    flex: 1;
    max-height: none;
    height: auto;
}

.btn-fs { font-size: 1rem; }
.btn-exit-fs { font-size: 1.1rem; background: rgba(255,107,53,0.25) !important; }
.btn-queue { font-size: 0.9rem; gap: 4px; }
.btn-queue #player-queue-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
}

/* Modo normal mobile — vídeo grande no topo, controles embaixo, lista rolável */
.player-section.player-inline-mode {
    position: relative;
    display: block !important;
    background: #000;
}

.player-section.player-inline-mode .player-wrapper {
    display: flex;
    flex-direction: column;
}

.player-section.player-inline-mode .player-video-wrap {
    width: 100%;
    background: #000;
}

.player-section.player-inline-mode #video-player {
    width: 100%;
    max-height: 45vh;
    min-height: 220px;
    object-fit: contain;
    display: block;
}

@media (orientation: landscape) and (max-height: 500px) {
    .player-section.player-inline-mode #video-player {
        max-height: 55vh;
        min-height: 160px;
    }
}

.player-section.player-inline-mode .now-playing {
    padding: 10px 16px;
}

.player-section.player-inline-mode .player-controls {
    flex-wrap: wrap;
    justify-content: center;
    padding: 12px 16px;
    gap: 10px;
}

body.player-inline-active .btn-add-queue,
body.player-inline-active #btn-queue-code {
    background: var(--primary) !important;
    color: #fff !important;
    font-weight: 700;
}

body.player-inline-active .song-actions .btn-add-queue {
    min-width: 44px;
    min-height: 44px;
    font-size: 1.1rem;
}
.now-playing { padding: 8px 16px; background: var(--bg-card); font-size: 0.9rem; color: var(--text-muted); }
.now-playing span:first-child { color: var(--primary); font-weight: 700; }
.player-controls { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--bg-card); flex-wrap: wrap; }
.btn-control { background: var(--bg-hover); border: none; color: var(--text); font-size: 1.2rem; padding: 8px 14px; border-radius: 8px; cursor: pointer; flex-shrink: 0; }
.volume-slider { flex: 1; min-width: 80px; accent-color: var(--primary); }
#volume-label { font-size: 0.8rem; color: var(--text-muted); min-width: 35px; flex-shrink: 0; }

/* CODE BAR */
.code-bar { display: flex; gap: 8px; padding: 12px 16px; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.code-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 2px;
}

/* SEARCH */
.search-container { padding: 12px 16px; }
.search-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text);
    font-size: 16px;
}
.search-input:focus { outline: none; border-color: var(--primary); }
.stats-row { display: flex; justify-content: space-between; margin-top: 8px; font-size: 0.8rem; color: var(--text-muted); }

/* QUEUE */
.queue-panel { margin: 0 16px 12px; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.queue-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.queue-header h3 { font-size: 0.95rem; }
.queue-list { list-style: none; max-height: 150px; overflow-y: auto; }
.queue-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.queue-list li:last-child { border-bottom: none; }
.queue-code { color: var(--primary); font-weight: 700; margin-right: 8px; }
.queue-remove { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 1rem; }

/* SONGS */
.songs-container { padding: 0 16px 80px; }
.song-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 6px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
    animation: fadeInUp 0.35s ease backwards;
    animation-delay: var(--delay, 0s);
}
.song-item:hover, .song-item:active {
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: -4px 0 0 var(--primary);
}
.song-code { background: var(--primary); color: #fff; padding: 6px 10px; border-radius: 6px; font-weight: 700; font-size: 0.85rem; min-width: 55px; text-align: center; }
.song-info { flex: 1; min-width: 0; }
.song-title { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-artist { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-actions { display: flex; gap: 6px; }
.song-actions button { background: var(--bg-hover); border: none; color: var(--text); padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 0.9rem; }

.loading { text-align: center; padding: 40px; color: var(--text-muted); }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* SCORE */
.score-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.92);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}
.score-card { text-align: center; padding: 40px 32px; background: linear-gradient(145deg, #1a1a1a, #2a1810); border-radius: 20px; border: 3px solid var(--primary); max-width: 360px; width: 90%; box-shadow: 0 0 40px rgba(255,107,53,0.3); }
.score-roulette-label { color: var(--primary); font-size: 0.9rem; min-height: 1.2em; margin-bottom: 8px; letter-spacing: 2px; }
.score-number { font-size: 5rem; font-weight: 900; color: var(--primary); line-height: 1; text-shadow: 0 0 20px rgba(255,107,53,0.5); transition: transform 0.08s; }
.score-number.spinning { animation: scoreSpin 0.07s linear infinite; }
.score-number.nota-10 { font-size: 4.5rem; color: #ffd700; text-shadow: 0 0 30px rgba(255,215,0,0.6); }
.score-card.score-pop { animation: scorePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
.score-countdown, .score-hint { font-size: 0.85rem; color: var(--text-muted); margin: 12px 0 8px; min-height: 1.2em; }
.confetti-piece {
    position: absolute; top: 30%; width: 8px; height: 8px; border-radius: 2px;
    animation: confettiFall 2s ease-out forwards;
    pointer-events: none;
}
@keyframes confettiFall {
    0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(80vh) translateX(var(--dx, 0)) rotate(720deg); opacity: 0; }
}
@keyframes scoreSpin { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes scorePop { 0% { transform: scale(0.7); opacity: 0.5; } 100% { transform: scale(1); opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bounceIn { 0% { transform: scale(0.5); opacity: 0; } 60% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
.anim-bounce-in { animation: bounceIn 0.6s ease; }
.anim-fade-in { animation: fadeInUp 0.5s ease backwards; animation-delay: var(--delay, 0s); }

/* HELP GUIDE */
.help-guide {
    margin: 12px 16px;
    background: linear-gradient(135deg, rgba(255,107,53,0.08), rgba(26,26,26,0.95));
    border: 1px solid rgba(255,107,53,0.35);
    border-radius: 14px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.help-guide.collapsed .help-body { display: none; }
.help-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 16px; cursor: pointer;
}
.help-header h2 { font-size: 1rem; color: var(--primary); font-weight: 600; }
.help-body { padding: 0 16px 16px; }
.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}
.help-card {
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}
.help-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.help-icon { font-size: 1.6rem; display: block; margin-bottom: 6px; }
.help-card strong { display: block; font-size: 0.85rem; color: #fff; margin-bottom: 4px; }
.help-card p { font-size: 0.75rem; color: var(--text-muted); line-height: 1.35; }
.help-tip { margin-top: 12px; font-size: 0.8rem; color: #aaa; text-align: center; padding: 8px; background: rgba(0,0,0,0.25); border-radius: 8px; }
.score-title { font-size: 1.3rem; font-weight: 700; color: #fff; margin: 12px 0 4px; }
.score-label { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 8px; }
.score-message { font-size: 1rem; color: #ccc; margin-bottom: 24px; }

/* SETTINGS */
.settings-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex; align-items: center; justify-content: center;
    z-index: 900;
    padding: 16px;
}
.settings-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
}
.settings-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.settings-header h2 { font-size: 1.2rem; color: var(--primary); }
.settings-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.settings-tab { flex: 1; padding: 10px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); border-radius: 8px; cursor: pointer; font-size: 0.85rem; }
.settings-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.settings-content.hidden { display: none; }
.settings-hint { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 16px; }
.settings-note { color: #888; font-size: 0.8rem; margin: 8px 0 16px; line-height: 1.4; }
.settings-note code { color: var(--primary); font-size: 0.75rem; }
.settings-status { background: rgba(255,107,53,0.1); border: 1px solid var(--primary); padding: 10px; border-radius: 8px; font-size: 0.85rem; color: var(--primary); margin-top: 12px; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 0.95rem; }
.toggle-row input { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; }
.slider-row { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--border); align-items: center; }
.slider-row input[type=range] { grid-column: 1 / -1; accent-color: var(--primary); }
.slider-row span:last-child { color: var(--primary); font-weight: 600; min-width: 40px; text-align: right; }
.settings-save { width: 100%; margin-top: 16px; }

/* TOAST */
.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: var(--bg-card); border: 1px solid var(--primary);
    padding: 12px 24px; border-radius: var(--radius);
    z-index: 2000; font-size: 0.9rem;
    animation: fadeIn 0.3s;
}
@keyframes fadeIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } }

@media (min-width: 768px) {
    :root { --sm-dock-height: 42vh; }
    body:not(.app-playing) .songs-container { padding-bottom: 40px; }
}

/* Celular em pé — controles cabem na tela, busca compacta */
@media (max-width: 600px) and (orientation: portrait) {
    .search-container { padding: 6px 12px; }
    .search-input {
        padding: 8px 12px;
        font-size: 14px;
    }
    .stats-row { margin-top: 4px; font-size: 0.72rem; }

    .code-bar { padding: 8px 12px; gap: 6px; }
    .code-input { padding: 8px 6px; font-size: 16px; letter-spacing: 1px; }
    .code-bar .btn-primary,
    .code-bar .btn-secondary {
        padding: 8px 10px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .player-section.player-inline-mode #video-player {
        max-height: 36vh;
        min-height: 160px;
    }

    .player-section.player-inline-mode .player-controls {
        gap: 6px;
        padding: 8px 10px;
    }

    .now-playing {
        font-size: 0.78rem;
        padding: 6px 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .player-controls {
        gap: 6px;
        padding: 8px 10px;
        justify-content: center;
    }

    .btn-control {
        font-size: 1rem;
        padding: 7px 11px;
    }

    .btn-queue { font-size: 0.85rem; padding: 7px 9px; }

    /* Volume na linha de baixo — libera espaço pros botões */
    .player-controls .volume-slider {
        flex: 1 1 100%;
        order: 10;
        min-width: 0;
        max-width: 100%;
    }

    .player-controls #volume-label {
        order: 11;
        flex: 0 0 auto;
        margin-left: auto;
    }
}
