/* ORBIA PLAY — aplicação da identidade visual (manual de identidade 1.0)
   Fundo azul-marinho #0B0F1F, violeta #6656C9, roxo de destaque #8B78FF, lavanda #C7B6FF, branco.
   Tipografia: Poppins (servida pelo próprio app, licença SIL OFL 1.1).
   O azul da órbita (#45C3FF) é exclusivo do símbolo e não é usado na interface. */

@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/Poppins-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/Poppins-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/Poppins-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-style: italic; font-weight: 500; font-display: swap; src: url('../fonts/Poppins-MediumItalic.ttf') format('truetype'); }
@font-face { font-family: 'Poppins'; font-style: italic; font-weight: 700; font-display: swap; src: url('../fonts/Poppins-BoldItalic.ttf') format('truetype'); }

:root {
  /* Paleta oficial */
  --navy: #0B0F1F;
  --violeta: #6656C9;
  --roxo: #8B78FF;
  --lavanda: #C7B6FF;
  --branco: #FFFFFF;

  /* Superfícies: o próprio azul-marinho, clareado em direção ao violeta */
  --bg: var(--navy);
  --surface: #121734;
  --raised: #1B2148;
  --line: #2A3163;
  --text: var(--branco);
  --muted: rgb(199 182 255 / .78);   /* lavanda: textos de apoio */
  --accent: var(--roxo);             /* destaques e botões */
  --accent-hover: var(--lavanda);
  --accent-ink: var(--navy);         /* texto sobre o roxo: contraste 5,1:1 */
  --danger: #F07C8C;

  /* Cores funcionais das categorias (estado, não marca) */
  --st-acompanhando: var(--roxo);
  --st-aguardando: var(--lavanda);
  --st-planejado: var(--branco);
  --st-pausado: #9C97BD;
  --st-finalizado: #5FD3A0;
  --st-abandonado: var(--danger);

  --font-display: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Poppins', 'Segoe UI', -apple-system, system-ui, sans-serif;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--safe-top) + 64px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--text); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -0.01em; }
h1 { font-size: 1.9rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
.display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.error { color: var(--danger); }
.row { display: flex; align-items: center; }
.gap { gap: .6rem; }
.wrap { flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }
:focus-visible { outline: 2px solid var(--lavanda); outline-offset: 2px; border-radius: 6px; }
svg { width: 20px; height: 20px; flex: none; }

/* ---------- Estrutura ---------- */
.shell { min-height: 100vh; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  background: rgba(11, 15, 31, .88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-right { display: flex; align-items: center; gap: .5rem; }
.brand { display: flex; align-items: center; text-decoration: none; line-height: 0; }
.brand img { display: block; height: auto; }
.topbar .brand img { width: 148px; }
.sidebar .brand img { width: 188px; }
#view { width: 100%; min-width: 0; padding: 20px 16px calc(96px + var(--safe-bottom)); max-width: 1180px; margin: 0 auto; outline: none; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + var(--safe-bottom));
  background: rgba(18, 23, 52, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 500; }
.tabbar svg, .side-nav svg, .icon-btn svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--accent); }
.tabbar .tab-add svg { background: var(--accent); color: var(--accent-ink); border-radius: 10px; width: 34px; height: 26px; padding: 3px 7px; stroke-width: 2.4; }
.tabbar .tab-add.active { color: var(--text); }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 236px 1fr; }
  .topbar, .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 1.5rem;
    position: sticky; top: 0; height: 100vh; padding: 24px 16px;
    border-right: 1px solid var(--line); background: var(--surface);
  }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-nav a { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border-radius: var(--r-sm); text-decoration: none; color: var(--muted); font-weight: 500; }
  .side-nav a:hover { background: var(--raised); color: var(--text); }
  .side-nav a.active { background: var(--raised); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
  .sidebar .sync-badge { margin-top: auto; align-self: flex-start; }
  #view { padding: 32px 40px 64px; }
  h1 { font-size: 2.3rem; }
}

/* ---------- Botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 42px; padding: .55rem 1.05rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--raised); color: var(--text);
  font: 600 .95rem/1 var(--font-body); text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: #4A4F86; color: var(--text); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.small { min-height: 34px; padding: .35rem .8rem; font-size: .85rem; }
.btn svg { width: 18px; height: 18px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--raised); }
.file-btn { position: relative; }

.input {
  width: 100%; min-height: 44px; padding: .55rem .85rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font: 400 1rem var(--font-body);
}
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(139, 120, 255, .28); }
.input.tiny { width: 5.5rem; min-height: 34px; display: inline-block; }
.tiny-date { width: auto; min-height: 34px; display: inline-block; margin-left: .4rem; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.2rem; }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .8rem; flex: 1; min-width: 140px; }
.field > span { font-size: .85rem; color: var(--muted); font-weight: 500; }
.field.inline { margin: 0; min-width: 170px; flex: 0 1 220px; }
.inline-field { margin-left: .3rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check input { margin-top: .25rem; accent-color: var(--accent); }

.chip { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; border: 1px solid currentColor; }
.st-acompanhando { --st: var(--st-acompanhando); }
.st-aguardando { --st: var(--st-aguardando); }
.st-planejado { --st: var(--st-planejado); }
.st-pausado { --st: var(--st-pausado); }
.st-finalizado { --st: var(--st-finalizado); }
.st-abandonado { --st: var(--st-abandonado); }
.chip[class*="st-"] { color: var(--st); }

/* ---------- Selo de sincronização ---------- */
.sync-badge { font-size: .75rem; font-weight: 600; text-decoration: none; padding: .25rem .65rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.sync-badge::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: .4rem; background: var(--muted); vertical-align: 1px; }
.sync-badge[data-state="ok"]::before { background: var(--st-finalizado); }
.sync-badge[data-state="busy"]::before { background: var(--roxo); animation: pulse 1s infinite alternate; }
.sync-badge[data-state="error"] { color: var(--danger); border-color: rgba(239, 122, 122, .4); }
.sync-badge[data-state="error"]::before { background: var(--danger); }
@keyframes pulse { to { opacity: .3; } }

/* ---------- A fita de episódios ---------- */
.strip {
  --n: 0;
  position: relative; height: 8px; border-radius: 3px; overflow: hidden;
  background: linear-gradient(90deg, rgba(255, 255, 255, .13) var(--r), rgba(255, 255, 255, .05) var(--r));
}
.strip::before { content: ''; position: absolute; inset: 0; width: var(--p); background: linear-gradient(90deg, var(--violeta), var(--roxo)); }
.strip[data-seg="1"]::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--n) - 2px), var(--strip-gap, var(--surface)) calc(100% / var(--n) - 2px) calc(100% / var(--n)));
}

/* ---------- Início ---------- */
.welcome { max-width: 680px; padding: 2rem 0; }
.welcome .display { font-size: clamp(2.2rem, 7vw, 3.6rem); margin-bottom: 1rem; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 60ch; }
.steps { padding-left: 1.3rem; margin: 1.5rem 0 2rem; display: grid; gap: .9rem; }
.steps li::marker { color: var(--accent); font-family: var(--font-display); font-weight: 700; }

.now { position: relative; border-radius: var(--r-lg); overflow: hidden; margin-bottom: 2rem; min-height: 340px; display: flex; align-items: flex-end; background: var(--surface); }
.now-art { position: absolute; inset: 0; background-size: cover; background-position: center 25%; }
.now-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 15, 31, .1) 0%, rgba(11, 15, 31, .78) 55%, var(--bg) 100%); }
.now-art-empty { background: radial-gradient(circle at 80% 0%, #2A2470, var(--surface)); }
.now-content { position: relative; padding: 28px 24px 22px; width: 100%; --strip-gap: rgba(11, 15, 31, .9); }
.now-kicker { color: var(--muted); font-weight: 600; margin-bottom: .2rem; }
.now-title { font-size: clamp(2rem, 6vw, 3.4rem); margin-bottom: .6rem; }
.now-title a { text-decoration: none; }
.caption { margin: 0 0 1.2rem; }
.caption span {
  display: inline; padding: .2rem .5rem; line-height: 1.75;
  background: rgba(11, 15, 31, .8); color: var(--lavanda);
  font-weight: 600; font-size: 1.08rem;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.now-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.2rem; }
.now-progress { display: grid; gap: .4rem; max-width: 520px; }

.block { margin: 0 0 2.2rem; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.block-head h2 { margin: 0; }
.block-head > a { font-size: .9rem; color: var(--muted); }

.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.rail-item { display: flex; flex-direction: column; gap: .4rem; scroll-snap-align: start; }
.rail-art { text-decoration: none; }
.rail-art .poster { aspect-ratio: 2 / 3; }
.rail-name { font-weight: 600; font-size: .9rem; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rail-item .btn { align-self: flex-start; }

.agenda { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.agenda-item { display: grid; grid-template-columns: 7.5rem 1fr; column-gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.agenda-when { grid-row: span 2; color: var(--muted); font-size: .88rem; font-weight: 600; }
.agenda-when.is-today { color: var(--accent); }
.agenda-title { font-weight: 600; text-decoration: none; }
.summary { padding: 1.1rem 1.25rem; background: var(--surface); border-radius: var(--r-md); border-left: 3px solid var(--accent); }
.summary p { margin-bottom: .4rem; }
.summary a { font-size: .9rem; color: var(--muted); }

/* ---------- Pôsteres e grade ---------- */
.poster { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--r-sm); background: var(--raised); }
.poster.small { width: 64px; flex: none; }
.poster.big { width: 170px; flex: none; border-radius: var(--r-md); box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .8); }
.poster-fallback { text-decoration: none; display: grid; place-items: center; background: linear-gradient(160deg, #2A2F66, #151A3A); }
.poster-fallback span { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; color: var(--accent); }
.poster.small.poster-fallback span { font-size: 1rem; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-head h1 { margin: 0; }

.tabs { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: 4px; margin-bottom: 1rem; scrollbar-width: none; }
.tab { flex: none; display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 600 .88rem var(--font-body); cursor: pointer; }
.tab::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--st, var(--muted)); }
.tab:not([class*="st-"])::before { display: none; }
.tab.active { background: var(--raised); color: var(--text); border-color: var(--st, var(--text)); }
.tab .count { font-weight: 500; color: var(--muted); font-size: .8rem; }

.filters { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.4rem; }
.filters .input { flex: 1; min-width: 180px; max-width: 340px; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: .35rem .8rem; border-radius: 999px; font: 600 .85rem var(--font-body); cursor: pointer; }
.seg button.active { background: var(--raised); color: var(--text); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 22px 16px; }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); } }
.tcard { display: flex; flex-direction: column; gap: .55rem; text-decoration: none; }
.tcard-art { position: relative; }
.tcard:hover .poster { outline: 2px solid var(--accent); outline-offset: 2px; }
.type-tag { position: absolute; left: 8px; top: 8px; font-size: .7rem; font-weight: 600; padding: .1rem .45rem; border-radius: 6px; background: rgba(11, 15, 29, .82); color: var(--text); }
.tcard-info { display: grid; gap: .3rem; }
.tcard-name { font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard .strip { --strip-gap: var(--bg); height: 6px; }

.empty { text-align: center; padding: 3rem 1rem; max-width: 460px; margin: 0 auto; }
.empty p { color: var(--muted); }

/* ---------- Adicionar ---------- */
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-md); padding: 1rem 1.2rem; margin-bottom: 1.2rem; }
.searchbar { display: flex; gap: .6rem; margin-bottom: .6rem; max-width: 640px; }
.results { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: 2px; }
.result { display: flex; gap: 1rem; align-items: center; padding: .8rem; border-radius: var(--r-md); }
.result:hover { background: var(--surface); }
.result-info { flex: 1; min-width: 0; display: grid; gap: .15rem; }
.result-info p { margin: .2rem 0 0; color: var(--muted); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Detalhe do título ---------- */
.detail-hero { position: relative; margin: -20px -16px 1.5rem; padding: 28px 16px 0; overflow: hidden; }
@media (min-width: 900px) { .detail-hero { margin: -32px -40px 1.8rem; padding: 48px 40px 0; } }
.detail-bg { position: absolute; inset: 0; background-size: cover; background-position: center 20%; opacity: .32; }
.detail-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 15, 31, .3), var(--bg) 92%); }
.detail-top { position: relative; display: flex; gap: 1.4rem; align-items: flex-end; flex-wrap: wrap; }
.detail-info { flex: 1; min-width: 240px; }
.detail-info .display { font-size: clamp(1.9rem, 5vw, 3rem); }
.detail-controls { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1rem; }
@media (max-width: 560px) { .poster.big { width: 120px; } }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: 1rem; }
.facts > div { background: var(--surface); padding: .9rem 1rem; display: grid; gap: .1rem; }
.fact-num { font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; }
.fact-label { color: var(--muted); font-size: .82rem; }
.overview { max-width: 68ch; color: rgb(255 255 255 / .86); margin: 1rem 0 2rem; }

.season { border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: .7rem; background: var(--surface); }
.season > summary { list-style: none; cursor: pointer; padding: .9rem 1rem; display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; align-items: center; }
.season > summary::-webkit-details-marker { display: none; }
.season > summary .strip { grid-column: 1 / -1; }
.season-name { font-weight: 700; font-family: var(--font-display); font-size: 1.05rem; }
.season-count { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.season-count.done { color: var(--st-finalizado); }
.season-actions { padding: 0 1rem .6rem; }
.eps { list-style: none; margin: 0; padding: 0 .5rem .6rem; }
.ep { display: grid; grid-template-columns: 40px 2.2rem 1fr auto; grid-template-areas: "c n t t" "c n m u"; column-gap: .5rem; align-items: center; padding: .45rem .5rem; border-radius: var(--r-sm); }
.ep:hover { background: var(--raised); }
.ep-check { grid-area: c; width: 34px; height: 34px; border-radius: 50%; border: 2px solid #4A4F86; background: transparent; color: transparent; display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s; }
.ep-check svg { width: 18px; height: 18px; }
.ep-check:hover { border-color: var(--accent); color: rgba(139, 120, 255, .65); }
.ep.seen .ep-check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); animation: pop .22s ease-out; }
.ep-check:disabled { opacity: .35; cursor: not-allowed; }
@keyframes pop { 50% { transform: scale(1.15); } }
.ep-num { grid-area: n; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.ep-name { grid-area: t; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep.seen .ep-name { color: var(--muted); }
.ep.future .ep-name { color: var(--muted); font-style: italic; }
.ep-meta { grid-area: m; }
.ep-meta .sep::before { content: ''; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: currentColor; margin: 0 .45rem; vertical-align: middle; }
.ep-until { grid-area: u; color: var(--muted); opacity: 0; }
.ep:hover .ep-until, .ep-until:focus-visible { opacity: 1; }
@media (hover: none) { .ep-until { opacity: 1; } }
.movie-box { background: var(--surface); border-radius: var(--r-md); padding: 1.2rem; border: 1px solid var(--line); }

/* ---------- Calendário ---------- */
.cal-nav { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.cal-nav h2 { margin: 0; min-width: 11rem; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 2rem; }
.cal-wd { text-align: center; color: var(--muted); font-size: .8rem; font-weight: 600; padding: .3rem 0; }
.cal-cell { position: relative; min-height: 92px; padding: 6px; border-radius: var(--r-sm); border: 1px solid transparent; background: var(--surface); color: var(--text); text-align: left; display: flex; flex-direction: column; gap: 4px; cursor: pointer; font: inherit; overflow: hidden; }
.cal-cell.blank { background: transparent; cursor: default; }
.cal-cell:hover:not(.blank) { border-color: var(--line); }
.cal-cell.today .cal-d { background: var(--accent); color: var(--accent-ink); }
.cal-cell.selected { border-color: var(--accent); }
.cal-d { font-weight: 700; font-size: .85rem; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-items { display: grid; gap: 2px; min-width: 0; }
.cal-pill { font-size: .72rem; line-height: 1.3; padding: 1px 5px; border-radius: 4px; background: rgba(139, 120, 255, .2); color: var(--branco); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: .72rem; color: var(--muted); }
.cal-dot { display: none; }
@media (max-width: 640px) {
  .cal-cell { min-height: 52px; align-items: center; padding: 4px 2px; }
  .cal-items { display: none; }
  .cal-dot { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--roxo); color: var(--navy); font-size: .68rem; font-weight: 700; }
  .cal-nav h2 { min-width: 0; flex: 1; font-size: 1.1rem; }
}

/* ---------- Estatísticas ---------- */
.total-hero { margin-bottom: 2.4rem; }
.total-num { font-size: clamp(3.2rem, 12vw, 6rem); line-height: .95; margin: 0 0 .5rem; color: var(--lavanda); }
.type-split { display: grid; gap: .5rem; max-width: 560px; margin-top: 1.2rem; }
.type-row { display: grid; grid-template-columns: 5.5rem 1fr 5.5rem; align-items: center; gap: .8rem; margin-bottom: .4rem; }
.type-row > span:last-child { text-align: right; }
.bar { height: 10px; background: var(--surface); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; min-width: 2px; }
.chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 220px; align-items: end; background: var(--surface); padding: 14px 10px 8px; border-radius: var(--r-md); }
.chart-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font: inherit; }
.chart-bar { width: 100%; max-width: 38px; min-height: 2px; background: rgba(139, 120, 255, .5); border-radius: 4px 4px 1px 1px; transition: background .15s; }
.chart-col:hover .chart-bar, .chart-col.active .chart-bar { background: var(--accent); }
.chart-col.active { color: var(--text); }
.chart-val { font-size: .68rem; font-variant-numeric: tabular-nums; }
.chart-label { font-size: .74rem; font-weight: 600; }
.ranking { padding: 0; margin: 0; list-style: none; counter-reset: r; }
.ranking li { display: grid; grid-template-columns: 1.8rem minmax(0, 1.3fr) 1fr 9.5rem; gap: .8rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); counter-increment: r; }
.ranking li::before { content: counter(r); color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.ranking li > span { text-align: right; }
.ranking a { font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .ranking li { grid-template-columns: 1.6rem minmax(0, 1fr) auto; } .ranking .bar { display: none; } }

/* ---------- Configurações ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.2rem 1.25rem; max-width: 760px; }
.advanced { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .8rem; }
.advanced summary { cursor: pointer; color: var(--muted); font-weight: 600; margin-bottom: .8rem; }
.login { max-width: 420px; }

/* ---------- Janela e aviso ---------- */
dialog#modal { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); padding: 0; width: min(480px, calc(100vw - 24px)); max-height: calc(100vh - 40px); }
dialog#modal::backdrop { background: rgba(5, 7, 16, .72); backdrop-filter: blur(3px); }
.modal-body { padding: 1.4rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.radios { border: 0; padding: 0; margin: 0 0 1rem; display: grid; gap: .2rem; }
.radios legend { font-size: .85rem; color: var(--muted); font-weight: 500; margin-bottom: .4rem; padding: 0; }
.radio { display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem; border-radius: var(--r-sm); cursor: pointer; flex-wrap: wrap; }
.radio:hover { background: var(--raised); }
.radio input { accent-color: var(--accent); width: 18px; height: 18px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--st); }

#toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-bottom)); z-index: 60;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(520px, calc(100vw - 32px)); padding: .75rem 1.1rem; border-radius: var(--r-md);
  background: #262C5E; color: var(--text); font-weight: 500; font-size: .93rem;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .7); transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast[data-kind="error"] { background: #4A2340; }
@media (min-width: 900px) { #toast { bottom: 28px; left: calc(50% + 118px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Ajustes finos para telas pequenas */
.tabbar svg { height: 26px; width: 22px; }
.tabbar .tab-add svg { width: 34px; }
@media (max-width: 560px) {
  .agenda-item { grid-template-columns: 5.6rem 1fr; column-gap: .7rem; }
  .now-content { padding: 22px 18px 18px; }
}

/* v0.1.1: avisos de conta e listas em janelas */
.plain-list { margin: .4rem 0 .8rem; padding-left: 1.2rem; display: grid; gap: .35rem; }
.danger-callout { border-left-color: var(--danger); }
.callout.small p { margin-bottom: .5rem; }

/* ORBIA PLAY: boas-vindas com o símbolo e o slogan (Poppins Medium Italic, conforme o manual) */
.welcome-symbol { width: 132px; height: auto; margin-bottom: 1.4rem; }
.welcome .display.slogan { font-style: italic; font-weight: 500; letter-spacing: -0.01em; }

/* ---------- Inteligência de Episódios: janela de confirmação (0.3.0) ---------- */
dialog#modal:has(.sheet) { width: min(680px, calc(100vw - 24px)); }
.sheet { position: relative; }
.sheet::before { content: ''; position: absolute; left: -1.4rem; right: -1.4rem; top: -1.4rem; height: 3px;
  background: linear-gradient(90deg, var(--violeta), var(--roxo), var(--lavanda)); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.sheet-head { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: .6rem; }
.sheet-symbol { width: 46px; height: auto; flex: none; margin-top: .15rem; }
.sheet-title-name { margin: 0 0 .15rem; color: var(--muted); font-size: .85rem; font-weight: 500; }
.sheet-head h2 { margin: 0; font-size: 1.18rem; line-height: 1.3; }
.sheet-lead { color: rgb(255 255 255 / .86); margin: .4rem 0 1rem; font-size: .95rem; }
.sheet-lead strong { color: var(--branco); }
.sheet-facts { display: grid; grid-template-columns: 1fr 1.4fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: .8rem; }
.sheet-facts > div { background: var(--raised); padding: .7rem .9rem; display: grid; }
.sheet-num { font-weight: 700; font-size: 1.35rem; line-height: 1.2; color: var(--branco); }
.sheet-label { font-size: .8rem; color: var(--muted); }
.sheet-seasons { list-style: none; margin: 0 0 .8rem; padding: 0; max-height: 9.5rem; overflow-y: auto; }
.sheet-seasons li { display: flex; justify-content: space-between; gap: 1rem; padding: .38rem .1rem; border-bottom: 1px solid var(--line); font-size: .88rem; }
.sheet-seasons li span:last-child { color: var(--lavanda); text-align: right; }
.sheet-more { color: var(--muted); }
.sheet-note { font-size: .85rem; color: var(--muted); margin: 0 0 .8rem; }
.sheet-when { border: 0; padding: 0; margin: 0 0 1rem; }
.sheet-when legend { font-size: .88rem; font-weight: 500; padding: 0; margin-bottom: .45rem; }
.sheet-when legend span { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); }
.seg-when { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg-when label { position: relative; cursor: pointer; }
.seg-when input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-when span { display: block; text-align: center; padding: .42rem .3rem; border-radius: 999px; font-size: .84rem; font-weight: 500; color: var(--muted); }
.seg-when input:checked + span { background: var(--raised); color: var(--branco); box-shadow: inset 0 0 0 1px var(--roxo); }
.seg-when input:focus-visible + span { outline: 2px solid var(--lavanda); outline-offset: 1px; }
.when-date { margin-top: .55rem; max-width: 12rem; }
.sheet-when:not(:has(input[value="date"]:checked)) .when-date { display: none; }
.sheet-check { margin: 0 0 1rem; font-weight: 500; }
.sheet-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .6rem; }
.sheet-actions .btn.primary { order: 3; }
.sheet-actions .btn.ghost { order: 2; }
.sheet-actions .link-btn { order: 1; margin-right: auto; }
.link-btn { background: none; border: 0; color: var(--muted); font: 500 .92rem var(--font-body); padding: .6rem .4rem; cursor: pointer; border-radius: var(--r-sm); }
.link-btn:hover { color: var(--branco); }

/* Celular: a janela vira um painel que sobe da parte de baixo da tela */
@media (max-width: 560px) {
  dialog#modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0;
    max-height: 90vh; border-bottom: 0; animation: sobe .22s ease-out; }
  dialog#modal:has(.sheet) { width: 100vw; }
  .modal-body { padding: 1.4rem 1.1rem calc(1.1rem + var(--safe-bottom)); }
  .sheet::before { left: -1.1rem; right: -1.1rem; }
  .sheet-actions { flex-direction: column; align-items: stretch; }
  .sheet-actions .btn, .sheet-actions .link-btn { width: 100%; justify-content: center; min-height: 48px; }
  .sheet-actions .btn.primary { order: 1; }
  .sheet-actions .btn.ghost { order: 2; }
  .sheet-actions .link-btn { order: 3; margin: 0; }
  .sheet-facts { grid-template-columns: 1fr 1fr; }
}
@keyframes sobe { from { transform: translateY(24px); opacity: .4; } }

/* Diagnóstico de capas (0.3.1) */
.diag { display: grid; gap: 0; margin: 0 0 1rem; }
.diag > div { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.diag dt { color: var(--muted); }
.diag dd { margin: 0; text-align: right; font-weight: 500; }

/* ---------- ORBIA LEVELS (0.4.0) ---------- */
.level-chip { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "b n x" "b bar bar"; align-items: center; column-gap: .75rem; row-gap: .35rem;
  text-decoration: none; padding: .7rem 1rem; margin: 0 0 1.4rem; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); max-width: 520px; }
.level-chip:hover { border-color: var(--roxo); color: var(--text); }
.level-chip-badge { grid-area: b; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--navy);
  background: linear-gradient(135deg, var(--lavanda), var(--roxo) 55%, var(--violeta)); }
.level-chip-name { grid-area: n; font-weight: 700; }
.level-chip-xp { grid-area: x; color: var(--lavanda); font-weight: 500; font-size: .9rem; }
.level-chip-hint { grid-column: 1 / -1; font-size: .82rem; color: var(--muted); }
.level-chip-bar { grid-area: bar; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.level-chip-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--violeta), var(--roxo), var(--lavanda)); border-radius: 3px; }
.profile-level .level-chip { margin: .4rem 0 1rem; }

.emblem { position: relative; width: var(--size); height: var(--size); flex: none; }
.emblem svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.emblem-track { fill: none; stroke: rgba(199, 182, 255, .14); stroke-width: 9; }
.emblem-arc { fill: none; stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .8s ease-out; }
.emblem img { position: absolute; left: 50%; top: 50%; width: 52%; height: auto; transform: translate(-50%, -50%); }
.emblem-idx { position: absolute; right: 6%; bottom: 6%; width: 30%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); border: 2px solid var(--roxo); font-weight: 700; color: var(--branco); font-size: calc(var(--size) * .12); }

.journey-hero { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; padding: 1.6rem; margin-bottom: 1.4rem; border-radius: var(--r-lg);
  background: radial-gradient(120% 140% at 0% 0%, #1E1A52 0%, var(--surface) 55%); border: 1px solid var(--line); }
.journey-main { flex: 1; min-width: 240px; }
.journey-kicker { margin: 0 0 .2rem; color: var(--muted); font-weight: 500; font-size: .9rem; }
.journey-level { font-size: clamp(2rem, 6vw, 3rem); margin: 0; letter-spacing: -0.02em; }
.journey-xp { font-size: 1.25rem; font-weight: 500; color: var(--lavanda); margin: .1rem 0 1rem; }
.journey-bar { height: 12px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; max-width: 520px; }
.journey-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--violeta), var(--roxo), var(--lavanda)); transition: width .8s ease-out; }
.journey-next { margin: .6rem 0 .4rem; }
.journey-sync { color: var(--lavanda); }
.journey-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: 2.2rem; }
.journey-stats > div { background: var(--surface); padding: .9rem 1rem; display: grid; }

.ladder { list-style: none; margin: 0; padding: 0; position: relative; }
.ladder::before { content: ''; position: absolute; left: 9px; top: 12px; bottom: 12px; width: 2px; background: var(--line); }
.ladder li { position: relative; display: grid; grid-template-columns: 20px 1fr auto; gap: .9rem; align-items: center; padding: .5rem 0; }
.ladder-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line); z-index: 1; }
.ladder li.feito .ladder-dot { background: var(--roxo); border-color: var(--roxo); }
.ladder li.atual .ladder-dot { background: var(--lavanda); border-color: var(--lavanda); box-shadow: 0 0 0 5px rgba(199, 182, 255, .2); }
.ladder li.atual .ladder-name { font-weight: 700; color: var(--branco); }
.ladder li:not(.feito):not(.atual) .ladder-name { color: var(--muted); }

.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge { display: grid; justify-items: center; text-align: center; gap: .25rem; padding: 1rem .7rem; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); opacity: .45; }
.badge.on { opacity: 1; border-color: rgba(139, 120, 255, .55); }
.badge-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--raised); }
.badge.on .badge-icon { background: linear-gradient(135deg, var(--lavanda), var(--roxo) 55%, var(--violeta)); }
.badge-icon svg { width: 28px; height: 28px; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.badge.on .badge-icon svg { stroke: var(--navy); }
.badge-name { font-weight: 700; font-size: .92rem; }

.rewards { list-style: none; margin: 0 0 1rem; padding: 0; border-top: 1px solid var(--line); }
.reward { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: .8rem; align-items: baseline; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.reward-xp { font-weight: 700; color: var(--lavanda); font-variant-numeric: tabular-nums; }
.reward-temporada .reward-xp, .reward-serie .reward-xp { color: var(--roxo); }
@media (max-width: 560px) {
  .journey-hero { padding: 1.2rem; gap: 1.2rem; justify-content: center; text-align: center; }
  .journey-bar { margin: 0 auto; }
  .reward { grid-template-columns: 5.4rem 1fr; } .reward-when { grid-column: 2; }
  .journey-stats > div { padding: .7rem .6rem; } .journey-stats .fact-num { font-size: 1.2rem; }
}

/* Subida de nível */
.levelup { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 1.2rem;
  background: radial-gradient(circle at 50% 40%, rgba(102, 86, 201, .45), rgba(5, 7, 16, .9) 70%); animation: lv-fundo .35s ease-out; }
.levelup-card { text-align: center; max-width: 380px; display: grid; justify-items: center; gap: .3rem; animation: lv-sobe .55s cubic-bezier(.2, .9, .3, 1.2); }
.levelup-card h2 { font-size: clamp(2rem, 8vw, 2.8rem); margin: 0; }
.levelup-card .btn { margin-top: 1rem; min-width: 180px; }
.levelup-orbit { position: relative; margin-bottom: .6rem; }
.levelup-orbit::before { content: ''; position: absolute; inset: -22px; border-radius: 50%; border: 2px solid transparent;
  border-top-color: var(--lavanda); border-right-color: rgba(139, 120, 255, .6); animation: lv-orbita 2.4s linear infinite; }
.levelup-orbit::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; box-shadow: 0 0 60px 6px rgba(139, 120, 255, .45); animation: lv-brilho 1.8s ease-in-out infinite alternate; }
@keyframes lv-fundo { from { opacity: 0; } }
@keyframes lv-sobe { from { opacity: 0; transform: translateY(24px) scale(.92); } }
@keyframes lv-orbita { to { transform: rotate(360deg); } }
@keyframes lv-brilho { from { opacity: .45; } to { opacity: 1; } }
