/* ==========================================================
   Rádio Charme — visual do site e do app
   Temas: data-theme = light | dark | auto   ·   Cores: data-accent
   ========================================================== */
:root {
  --bg: #f3f5fb;
  --bg2: #e9edf8;
  --card: #ffffff;
  --text: #0e1630;
  --muted: #5d6784;
  --line: #dfe4f1;
  --accent: #2f5bff;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --danger: #d6264b;
  --ok: #138a4b;
  --shadow: 0 10px 30px rgba(20, 30, 80, .10);
  --radius: 20px;
  --top: 60px;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #0a0f20; --bg2: #101733; --card: #141c38; --text: #eef1ff; --muted: #9aa5c8; --line: #232d52;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #0a0f20; --bg2: #101733; --card: #141c38; --text: #eef1ff; --muted: #9aa5c8; --line: #232d52;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45); color-scheme: dark;
  }
}
html[data-accent="teal"]   { --accent: #0d9488; }
html[data-accent="green"]  { --accent: #16a34a; }
html[data-accent="orange"] { --accent: #f97316; }
html[data-accent="red"]    { --accent: #e11d48; }
html[data-accent="pink"]   { --accent: #ec4899; }
html[data-accent="purple"] { --accent: #7c3aed; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(900px 500px at 85% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(700px 420px at -10% 10%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
img { max-width: 100%; }
h1, h2 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.1rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
[hidden] { display: none !important; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  display: flex; align-items: center; gap: 8px; padding: 0 12px; padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; flex: 1; min-width: 0; }
.brand img { border-radius: 50%; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { background: none; border: 0; color: var(--text); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; font-size: 1.1rem; }
.icon-btn:hover { background: var(--accent-soft); }
.chip { text-decoration: none; font-weight: 800; font-size: .8rem; padding: 7px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

/* ---------- Menu lateral ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(5, 10, 30, .5); }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; width: min(84vw, 320px);
  background: var(--card); box-shadow: var(--shadow); transform: translateX(-102%); transition: transform .25s ease;
  padding: calc(env(safe-area-inset-top) + 14px) 10px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 6px 10px 14px; }
.drawer-head img { border-radius: 50%; }
.drawer-head small { display: block; color: var(--muted); }
.drawer a, .drawer-exit {
  display: block; padding: 13px 14px; border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 600;
  background: none; border: 0; text-align: left; font: inherit; font-weight: 600; cursor: pointer; width: 100%;
}
.drawer a:hover, .drawer-exit:hover { background: var(--accent-soft); }
.drawer hr { border: 0; border-top: 1px solid var(--line); margin: 8px 6px; }
.drawer-exit { color: var(--danger); margin-top: auto; }

/* ---------- Conteúdo ---------- */
main#content { max-width: 720px; margin: 0 auto; padding: 16px 14px 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.prose h2 { margin-top: 1.4em; } .prose ul { padding-left: 1.2em; } .prose li { margin: .3em 0; }
.flash { padding: 12px 14px; border-radius: 12px; margin: 0 0 12px; font-weight: 600; }
.flash-ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.flash-error { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

/* ---------- Carrossel de banners ---------- */
.carousel { position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow); background: var(--card); touch-action: pan-y; }
.carousel-track { display: flex; transition: transform .45s ease; }
.slide { flex: 0 0 100%; position: relative; display: block; aspect-ratio: 16 / 7; }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; }
.slide .ad-tag { position: absolute; left: 10px; top: 10px; font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: rgba(0,0,0,.55); color: #fff; padding: 3px 8px; border-radius: 999px; }
.carousel-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 6px; }
.carousel-dots button { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.55); cursor: pointer; }
.carousel-dots button.on { background: #fff; width: 20px; border-radius: 6px; }

/* ---------- Player ---------- */
.player { text-align: center; padding: 14px; }
/* Vitrola: painel escuro, visor no topo, disco com a capa no centro e braço que desce ao tocar */
.deck {
  --dk: #0d1118; position: relative; border-radius: 22px; padding: 12px 12px 14px; overflow: hidden; color: #eaf1ff;
  background: var(--player-bg, none) center / cover, repeating-linear-gradient(90deg, #151a24 0 2px, #10141c 2px 4px);
  background-color: var(--dk); box-shadow: inset 0 0 0 1px #2a3142, inset 0 2px 18px rgba(0,0,0,.7), 0 14px 34px rgba(0,0,0,.28);
}
.lcd {
  border-radius: 10px; padding: 9px 12px 10px; text-align: left; border: 2px solid #05080d; position: relative; z-index: 2;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 55%, #0a1a3a), color-mix(in srgb, var(--accent) 25%, #04101f));
  box-shadow: inset 0 0 22px rgba(120,190,255,.45), 0 0 0 1px #2d3547;
}
.lcd-top { display: flex; align-items: center; gap: 6px; font-size: .66rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #bfe0ff; }
.lcd-fm { margin-left: auto; opacity: .75; }
.lcd .np-song { font-size: 1.12rem; margin: 4px 0 0; color: #fff; line-height: 1.2; text-shadow: 0 0 10px rgba(150,210,255,.8); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lcd .np-artist { margin: 1px 0 4px; color: #cfe6ff; font-size: .88rem; min-height: 1.3em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.bars i { flex: 1; height: 3px; border-radius: 2px; background: #9fd2ff; opacity: .45; }
body.is-playing .bars i { opacity: 1; animation: bar 1s ease-in-out infinite; }
.bars i:nth-child(3n+2) { animation-delay: -.3s !important; } .bars i:nth-child(3n) { animation-delay: -.65s !important; } .bars i:nth-child(4n) { animation-delay: -.5s !important; }
@keyframes bar { 0%, 100% { height: 3px; } 50% { height: 18px; } }

.platter { position: relative; margin-top: 12px; aspect-ratio: 1 / .94; }
.platter::before { /* prato metálico com pontinhos de estroboscópio */
  content: ""; position: absolute; left: 3%; top: 2%; width: 88%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, transparent 66%, #cdd3df 66.5% 68%, #5b6374 68.5%), repeating-conic-gradient(#2a303d 0 2deg, #aab3c4 2deg 4deg);
  box-shadow: 0 0 0 3px #060910, 0 6px 18px rgba(0,0,0,.6);
}
.vinyl {
  position: absolute; left: 7%; top: 6%; width: 80%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background:
    conic-gradient(from 20deg, rgba(255,255,255,0) 0 10%, rgba(255,255,255,.16) 15%, rgba(255,255,255,0) 22% 55%, rgba(255,255,255,.12) 62%, rgba(255,255,255,0) 70%),
    repeating-radial-gradient(circle, #0b0d12 0 2px, #181c25 2px 3px);
  box-shadow: 0 0 0 2px #000, 0 8px 24px rgba(0,0,0,.65);
  animation: spin 5.5s linear infinite; animation-play-state: paused;
}
body.is-playing .vinyl { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }
.disc {
  width: 40%; aspect-ratio: 1; border-radius: 50%; background-size: cover; background-position: center; background-color: #1b2a8a;
  border: 3px solid #0a0c10; box-shadow: 0 0 0 2px var(--accent); transition: background-image .3s; -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none;
}
.spindle { position: absolute; width: 4%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #8a93a6 60%, #3a4150); }

/* Braço: gira no pino (canto superior direito); repouso fora do disco, tocando sobre os sulcos */
.arm { position: absolute; right: 5%; top: 3%; width: 12%; height: 0; z-index: 3; pointer-events: none; }
.arm-base { position: absolute; left: 50%; top: 0; width: 100%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f5f7fb, #8d96a8 55%, #2b3140); box-shadow: 0 3px 8px rgba(0,0,0,.6), 0 0 0 3px #1a1f2b; }
.arm-svg { position: absolute; left: 0; top: 0; width: 100%; height: auto; aspect-ratio: 60 / 300; overflow: visible; transform-origin: 50% 0; transform: rotate(-4deg);
  transition: transform 1.3s cubic-bezier(.45,.05,.25,1); filter: drop-shadow(4px 6px 5px rgba(0,0,0,.55)); }
body.is-buffering .arm-svg { transform: rotate(12deg); }
body.is-playing .arm-svg { transform: rotate(23deg); }
body.is-playing .arm-svg { animation: tracking 9s ease-in-out 1.4s infinite alternate; }
@keyframes tracking { from { transform: rotate(23deg); } to { transform: rotate(24.5deg); } }
@media (prefers-reduced-motion: reduce) { .vinyl, .arm-svg { animation: none !important; transition-duration: .01s; } }

.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
body.is-playing .live-dot { animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.btn-play {
  margin-top: 16px; width: 84px; height: 84px; border-radius: 50%; border: 0; cursor: pointer; background: var(--accent); color: var(--accent-ink);
  display: inline-grid; place-items: center; box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 50%, transparent); transition: transform .12s;
}
.btn-play:active { transform: scale(.94); }
.i-pause { display: none; } body.is-playing .i-play { display: none; } body.is-playing .i-pause { display: block; }
.status { margin: 10px 0 4px; color: var(--muted); font-size: .9rem; min-height: 1.4em; }
body.is-buffering .status { color: var(--accent); font-weight: 700; }
.tools { display: flex; justify-content: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.tool { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 999px; padding: 10px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.tool:hover { border-color: var(--accent); }
.volume { display: flex; align-items: center; gap: 12px; margin-top: 16px; color: var(--muted); font-weight: 600; font-size: .9rem; }
body[data-app="1"] .volume { display: none; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.history { margin: 0; padding-left: 0; list-style: none; }
.history li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.history li:last-child { border-bottom: 0; }
.history small { display: block; color: var(--muted); }

/* ---------- Mini player ---------- */
.minibar {
  position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20; max-width: 700px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 18px;
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); border: 1px solid var(--line); box-shadow: var(--shadow);
}
body[data-page="home"] .minibar { display: none; }
.mini-cover { width: 46px; height: 46px; border-radius: 50%; background: #1b2a8a center / cover; flex: none; }
body.is-playing .mini-cover { animation: spin 24s linear infinite; }
.mini-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini-text strong, .mini-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-text small { color: var(--muted); }
.mini-play { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; }

/* ---------- Painéis (sleep / equalizador) ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; background: rgba(5, 10, 30, .55); display: flex; align-items: flex-end; justify-content: center; }
.sheet-body { width: 100%; max-width: 560px; background: var(--card); border-radius: 24px 24px 0 0; padding: 18px 18px calc(24px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; animation: up .22s ease; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { margin: 0; font-size: 1.2rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip-btn { border: 1px solid var(--line); background: var(--bg); color: var(--text); padding: 10px 16px; border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block; }
.chip-btn:hover, .chip-btn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip-off { color: var(--danger); }
.eq-row { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; margin: 10px 0; font-size: .9rem; color: var(--muted); font-weight: 700; }
.eq-top { display: flex; justify-content: space-between; align-items: center; margin: 10px 0; }

/* ---------- Formulários e botões ---------- */
.form label { display: block; font-weight: 700; margin: 14px 0 6px; }
.form input[type=text], .form input[type=email], .form input[type=password], .form input[type=url], .form input[type=number], .form input[type=date],
.form select, .form textarea {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); font: inherit;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form .check, .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; cursor: pointer; margin: 14px 0; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn { display: inline-block; padding: 13px 20px; border-radius: 14px; border: 1px solid transparent; font: inherit; font-weight: 800; cursor: pointer; text-decoration: none; text-align: center; margin: 14px 8px 0 0; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.form .btn-primary { width: 100%; margin-right: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.seg button, .seg a { padding: 10px 16px; border: 0; background: none; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.seg .on { background: var(--accent); color: var(--accent-ink); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--card); background: var(--sw); box-shadow: 0 0 0 2px var(--line); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 3px var(--text); }

/* ---------- Rodapé e aviso ---------- */
.footer { max-width: 720px; margin: 8px auto 0; padding: 14px; text-align: center; color: var(--muted); }
.footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-bottom: 6px; }
.footer a { color: var(--muted); font-size: .88rem; }
.webad { margin: 0 auto 12px; overflow: hidden; }
.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 80;
  background: #111a3a; color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; max-width: 88vw; text-align: center; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }


/* ---------- v2: clube, conta, compartilhar, instalar, páginas ---------- */
.carousel.is-hidden-page { display: none; }
.club-hero { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--card)), var(--card)); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; background: var(--accent-soft); color: var(--accent); }
.b-ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.benefits { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 10px; }
.benefits li { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.benefits li span { color: var(--muted); font-size: .92rem; }
.data-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 12px; }
.data-list dt { color: var(--muted); font-weight: 600; } .data-list dd { margin: 0; font-weight: 700; word-break: break-word; }
.locked, .tool.locked { opacity: .75; text-decoration: none; }
.locked-card { border-style: dashed; }
.swatches.is-locked { opacity: .45; filter: grayscale(.4); pointer-events: none; }
.math-input { max-width: 120px; text-align: center; font-size: 1.1rem; font-weight: 800; }
.alarm-box { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 4px; }
.alarm-box[hidden] { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.eq-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.eq-row { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 10px; margin: 6px 0; font-size: .9rem; color: var(--muted); }
.share-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.share-item { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.share-item:hover { border-color: var(--accent); }
.s-whatsapp { background: #25d366; color: #05220f; border-color: transparent; } .s-facebook { background: #1877f2; color: #fff; border-color: transparent; }
.s-telegram { background: #2aabee; color: #04202e; border-color: transparent; } .s-x { background: #111; color: #fff; border-color: transparent; }
.drawer-btn { display: block; width: 100%; text-align: left; padding: 12px 14px; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; border-radius: 12px; cursor: pointer; }
.drawer-btn:hover { background: var(--accent-soft); }
.drawer-btn[hidden] { display: none; }
.install-steps { padding-left: 20px; display: grid; gap: 8px; }
.hero { margin: 0 0 16px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hero img { display: block; width: 100%; height: auto; max-height: 280px; object-fit: cover; -webkit-user-drag: none; }
.prose { overflow-wrap: anywhere; line-height: 1.65; }
.prose img, .prose video, .prose iframe { max-width: 100%; height: auto; border-radius: 12px; }
.prose table { display: block; max-width: 100%; overflow-x: auto; }
.embed { position: relative; aspect-ratio: 16 / 9; margin: 14px 0; border-radius: 14px; overflow: hidden; background: #000; }
.embed iframe, .embed video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.minibar .mini-status { color: var(--accent); font-weight: 700; }

@media (min-width: 900px) { main#content { padding-top: 28px; } .minibar { bottom: 16px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
