/* =========================================================
   Páginas
   ========================================================= */

/* ---------------- Landing ---------------- */
.landing { background: var(--bg); min-height: 100dvh; overflow-x: hidden; }
.landing-nav {
  position: absolute; z-index: 10; left: 0; right: 0; top: 0;
  display: flex; align-items: center; gap: var(--sp-4);
  padding: calc(var(--sp-5) + var(--safe-top)) clamp(16px, 4vw, 56px) var(--sp-5);
}
.landing-nav__brand { display: flex; align-items: center; gap: 10px; color: #F3EDF4; text-decoration: none !important; }
.landing-nav__brand img { width: 34px; height: 34px; }
.landing-nav__brand span { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; }
.landing-nav__brand b { color: #E58AA6; font-weight: 600; }
.landing-nav__links { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }
.landing-nav__links .btn--ghost { --btn-fg: #d9cfe0; }
.landing-nav__links .btn--ghost:hover { --btn-fg: #fff; --btn-bg: rgba(158,121,188,.18); }
@media (max-width: 640px) { .landing-nav__links .hide-sm { display: none; } }

.hero {
  position: relative; min-height: min(100dvh, 980px); display: grid; place-items: center;
  padding: calc(120px + var(--safe-top)) clamp(16px, 4vw, 56px) 120px;
  background: #0D0B12; color: #F3EDF4; overflow: hidden; isolation: isolate;
}
.hero__sky {
  position: absolute; inset: -10%; z-index: -3;
  background:
    radial-gradient(60% 45% at 50% 38%, rgba(158,121,188,.20), transparent 70%),
    radial-gradient(30% 30% at 78% 22%, rgba(167,61,94,.18), transparent 70%),
    linear-gradient(180deg, rgba(13,11,18,.35), rgba(13,11,18,.75) 70%, #0D0B12),
    url("../assets/art/sky-dark.webp") 50% 45% / cover no-repeat,
    #0D0B12;
}
.hero__eclipse {
  position: absolute; z-index: -2; width: min(980px, 130vw); aspect-ratio: 1; border-radius: 50%;
  left: 50%; top: 50%; transform: translate(-46%, -64%);
  background: radial-gradient(circle at 46% 48%, #07060a 0 56%, #0c0a11 62%, transparent 71%);
  box-shadow:
    inset -18px 14px 50px -20px rgba(229, 138, 166, .55),
    0 0 120px -10px rgba(167,61,94,.35),
    0 0 220px 10px rgba(158,121,188,.16);
  animation: eclipseBreath 9s ease-in-out infinite;
}
.hero__eclipse::after {
  content: ""; position: absolute; inset: -2px; border-radius: 50%;
  background: conic-gradient(from 200deg, transparent 0 40%, rgba(229,138,166,.55) 52%, rgba(216,189,229,.35) 58%, transparent 70% 100%);
  -webkit-mask: radial-gradient(circle, transparent 69.4%, #000 70%, transparent 71.5%);
          mask: radial-gradient(circle, transparent 69.4%, #000 70%, transparent 71.5%);
  filter: blur(2px);
}
@keyframes eclipseBreath { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.18); } }
.hero__mist {
  position: absolute; inset: auto -20% -10% -20%; height: 55%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 60% at 20% 80%, rgba(80,58,96,.55), transparent 70%),
    radial-gradient(35% 55% at 60% 90%, rgba(70,40,70,.55), transparent 70%),
    radial-gradient(40% 60% at 92% 75%, rgba(80,58,96,.45), transparent 70%);
  filter: blur(18px);
  animation: mistDrift 26s ease-in-out infinite alternate;
}
@keyframes mistDrift { from { transform: translateX(-3%); } to { transform: translateX(3%); } }
.hero__particles { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .55;
  background-image:
    radial-gradient(1px 1px at 12% 22%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 72% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 84% 44%, #D8BDE5 50%, transparent 51%), radial-gradient(1px 1px at 32% 62%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 8%, #D8BDE5 50%, transparent 51%), radial-gradient(1.2px 1.2px at 92% 70%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 52%, #D8BDE5 50%, transparent 51%), radial-gradient(1px 1px at 42% 32%, #fff 50%, transparent 51%);
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .35; } to { opacity: .7; } }
.hero__inner { position: relative; text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--sp-6); max-width: 1080px; }
.hero__logo {
  width: min(760px, 92vw); aspect-ratio: 1080 / 590; border-radius: 20px;
  -webkit-mask: radial-gradient(closest-side ellipse at 50% 52%, #000 58%, transparent 100%);
          mask: radial-gradient(closest-side ellipse at 50% 52%, #000 58%, transparent 100%);
  animation: logoIn 1.4s var(--ease-out) both;
}
@keyframes logoIn { from { opacity: 0; transform: scale(1.03); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.hero__title { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-hero); line-height: 1.02; letter-spacing: -.005em; text-wrap: balance; }
.hero--compact { min-height: auto; padding-block: calc(140px + var(--safe-top)) 96px; }
.hero__title em { font-style: italic; color: #E58AA6; }
.hero__lead { font-size: clamp(1rem, .9rem + .4vw, 1.2rem); color: #c7bccf; max-width: 58ch; }
.hero__ctas { display: flex; gap: var(--sp-3); flex-wrap: wrap; justify-content: center; }
.hero .btn--outline { --btn-fg: #F3EDF4; --btn-bd: rgba(216,189,229,.35); }
.hero .btn--outline:hover { --btn-bg: rgba(158,121,188,.15); }
.hero__note { font-size: var(--fs-xs); color: #8f8499; }
.hero__fan { position: absolute; bottom: -30px; left: 50%; transform: translateX(-50%); display: flex; gap: 0; pointer-events: none; z-index: -1; opacity: .9; }
@media (prefers-reduced-motion: reduce) { .hero__eclipse, .hero__mist, .hero__particles { animation: none; } }

.landing-section { padding: clamp(64px, 9vw, 120px) clamp(16px, 4vw, 56px); position: relative; }
.landing-section__inner { max-width: 1200px; margin: 0 auto; }
.landing-kicker { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .2em; color: var(--primary); font-weight: 800; }
.landing-h2 { font-family: var(--font-display); font-size: clamp(2rem, 1.4rem + 2.4vw, 3.4rem); font-weight: 600; line-height: 1.06; margin-top: var(--sp-3); }
.landing-lead { color: var(--text-2); margin-top: var(--sp-4); max-width: 60ch; font-size: var(--fs-lg); }
.feature-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.feature-row--flip { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.feature-row--flip .feature-row__text { order: 2; }
@media (max-width: 900px) { .feature-row, .feature-row--flip { grid-template-columns: minmax(0, 1fr); } .feature-row--flip .feature-row__text { order: 0; } }
.feature-list { list-style: none; padding: 0; margin: var(--sp-6) 0 0; display: grid; gap: var(--sp-3); }
.feature-list li { display: flex; gap: var(--sp-3); align-items: flex-start; color: var(--text-2); }
.feature-list li svg { width: 18px; height: 18px; color: var(--primary); flex: none; margin-top: 3px; }
.feature-list li strong { color: var(--text); }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); margin-top: var(--sp-10); }
@media (max-width: 900px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: minmax(0, 1fr); } }
.feature-card { padding: var(--sp-6); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--sp-3); transition: transform var(--dur-3) var(--ease-out), border-color var(--dur-3); }
.feature-card:hover { transform: translateY(-3px); border-color: var(--border-2); }
.feature-card__icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.feature-card__icon svg { width: 22px; height: 22px; }
.feature-card h3 { font-size: var(--fs-lg); }
.feature-card p { color: var(--text-2); font-size: var(--fs-sm); }
.landing-cta { text-align: center; color: #F3EDF4; padding-block: clamp(96px, 12vw, 160px);
  background: radial-gradient(45% 55% at 50% 50%, rgba(12,10,16,.7), transparent 75%), linear-gradient(180deg, rgba(12,10,16,.82), rgba(12,10,16,.55) 45%, rgba(12,10,16,.85)), url("../assets/art/universe.webp") 50% 40% / cover no-repeat, #15111D; }
.landing-cta .landing-lead { color: #D6CBDD; }
.landing-cta .btn--outline { --btn-fg: #F3EDF4; --btn-bd: rgba(216,189,229,.35); }
.landing-footer { padding: var(--sp-10) clamp(16px, 4vw, 56px) calc(var(--sp-10) + var(--safe-bottom)); border-top: 1px solid var(--border); color: var(--text-3); font-size: var(--fs-xs); }
.landing-footer__inner { max-width: 1200px; margin: 0 auto; display: flex; gap: var(--sp-4); justify-content: space-between; flex-wrap: wrap; }

.mock-frame { border-radius: var(--r-xl); border: 1px solid var(--border-2); background: var(--surface); box-shadow: var(--shadow-3); padding: var(--sp-4); }
.mini-deck { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mini-tree { display: grid; gap: 6px; font-size: var(--fs-sm); }
.mini-tree div { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--bg-2); }
.mini-tree svg { width: 15px; height: 15px; color: var(--primary); }

/* ---------------- Auth ---------------- */
/* ---------------- Tela de entrada (#/) ---------------- */
.welcome { height: 100dvh; min-height: 560px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(400px, 1fr); background: var(--bg); }

/* Palco do eclipse: sempre noturno, nos dois temas. O fundo repete a cor da própria arte
   (#0C0A10) para que as bordas esmaecidas da imagem se fundam sem costura. */
.welcome__stage { position: relative; overflow: hidden; isolation: isolate; min-height: 100%; background: var(--bg); }
/* Arte da entrada: uma para cada tema. As duas ficam empilhadas e a do tema ativo aparece,
   então a troca de tema dissolve uma na outra. A logo fica perto de 46% da altura da arte. */
.welcome__scene { position: absolute; inset: 0; background-size: cover; background-position: 50% 46%; background-repeat: no-repeat; transition: opacity .8s ease; }
.welcome__scene--dark { background-image: url("../assets/logos/duskdex-login-dark.webp"); background-color: #0C0A10; }
.welcome__scene--light { background-image: url("../assets/logos/duskdex-login-light.webp"); background-color: #E9DDF0; opacity: 0; }
:root[data-theme="light"] .welcome__scene--light { opacity: 1; }
:root[data-theme="light"] .welcome__scene--dark { opacity: 0; }
.welcome__scene { animation: welcomeArt 1.6s var(--ease-out) both; }
@keyframes welcomeArt { from { transform: scale(1.02); } to { transform: none; } }
/* Transição suave entre a arte e o painel */
.welcome__stage::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 22%; z-index: 1; pointer-events: none; background: linear-gradient(90deg, transparent, var(--bg)); }

.welcome__panel {
  display: flex; flex-direction: column; gap: var(--sp-4); overflow-y: auto;
  padding: calc(var(--sp-5) + var(--safe-top)) clamp(20px, 3.5vw, 56px) calc(var(--sp-4) + var(--safe-bottom));
  background: var(--bg);
}
.welcome__top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.welcome__about { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); }
.welcome__about svg { width: 16px; height: 16px; color: var(--primary); }
.welcome__card { width: min(400px, 100%); margin: auto auto 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.welcome__title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.7rem, 1.3rem + 1.1vw, 2.25rem); line-height: 1.05; text-wrap: balance; }
.welcome__lead { color: var(--text-2); margin-top: calc(-1 * var(--sp-2)); font-size: var(--fs-sm); }
.welcome__form { display: flex; flex-direction: column; gap: var(--sp-3); }
.welcome .input { height: 42px; }
.welcome .btn--lg { min-height: 44px; }
.welcome__fine { text-align: center; }
.welcome__or { display: flex; align-items: center; gap: var(--sp-3); color: var(--text-3); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .14em; }
.welcome__or::before, .welcome__or::after { content: ""; flex: 1; height: 1px; background: var(--border-2); }
.welcome__guest { width: 100%; }
.welcome__legal { font-size: var(--fs-xs); color: var(--text-3); text-align: center; max-width: 52ch; margin: 0 auto; }

/* Alternância Entrar | Criar conta */
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 4px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.seg__item { text-align: center; padding: 9px 12px; border-radius: 9px; font-weight: 700; font-size: var(--fs-sm); color: var(--text-2); text-decoration: none !important; transition: background var(--dur-2), color var(--dur-2); }
.seg__item:hover { color: var(--text); }
.seg__item[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

@media (max-width: 1023px) {
  .welcome { grid-template-columns: minmax(0, 1fr); height: auto; }
  .welcome__panel { overflow: visible; }
  .welcome__stage { min-height: min(62svh, 560px); }
  .welcome__scene { background-position: 50% 44%; }
  .welcome__stage::after { inset: auto 0 0 0; width: auto; height: 90px; background: linear-gradient(180deg, transparent, var(--bg)); }
  .welcome__panel { position: relative; padding-top: var(--sp-2); }
  .welcome__card { margin: 0 auto; }
}
@media (max-width: 480px) { .welcome .form-grid { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .welcome__scene { animation: none; transition: none; } }

/* ---------------- Dashboard ---------------- */
.dash { display: grid; gap: var(--sp-5); grid-template-columns: repeat(12, minmax(0, 1fr)); }
.dash > * { min-width: 0; }
.dash__hero { grid-column: span 12; }
.dash__kpis { grid-column: span 12; display: grid; gap: var(--sp-4); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash__main { grid-column: span 8; display: flex; flex-direction: column; gap: var(--sp-5); }
.dash__side { grid-column: span 4; display: flex; flex-direction: column; gap: var(--sp-5); }
@media (max-width: 1100px) { .dash__main, .dash__side { grid-column: span 12; } }
@media (max-width: 860px) { .dash__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.greet {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: clamp(22px, 3vw, 36px);
  background:
    linear-gradient(90deg, rgba(12,10,16,.92) 0%, rgba(12,10,16,.7) 42%, rgba(12,10,16,.15) 100%),
    url("../assets/art/twilight-cards.webp") 50% 55% / cover no-repeat,
    #15111D;
  color: #F3EDF4; border: 1px solid rgba(216,189,229,.12);
  display: flex; align-items: center; gap: var(--sp-6); justify-content: space-between; flex-wrap: wrap;
  min-height: 190px;
}
.greet__eyebrow { font-size: var(--fs-xs); letter-spacing: .18em; text-transform: uppercase; color: #D8BDE5; font-weight: 700; }
.greet h1 { font-family: var(--font-display); font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.8rem); font-weight: 600; margin-top: 6px; }
.greet p { color: #c7bccf; margin-top: 6px; }
.greet .btn-group { position: relative; z-index: 1; }
.greet .btn--outline { --btn-fg: #F3EDF4; --btn-bd: rgba(216,189,229,.3); }
.kpi { padding: var(--sp-5); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--sp-3); position: relative; overflow: hidden; }
.kpi__icon { width: 36px; height: 36px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.kpi__icon svg { width: 18px; height: 18px; }
.kpi--crimson .kpi__icon { background: var(--crimson-soft); color: var(--crimson-text); }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 128px; gap: var(--sp-3); overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.strip > * { scroll-snap-align: start; }
.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.quick button, .quick a { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--border); color: var(--text); font-weight: 600; font-size: var(--fs-sm); cursor: pointer; text-decoration: none !important; text-align: left; }
.quick button:hover, .quick a:hover { border-color: var(--primary); background: var(--primary-soft); }
.quick svg { width: 18px; height: 18px; color: var(--primary); flex: none; }

/* ---------------- Fichários: lista ---------------- */
.binder-cards { display: grid; gap: var(--sp-6) var(--sp-5); grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.binder-card { display: flex; flex-direction: column; gap: var(--sp-3); cursor: pointer; text-decoration: none !important; color: var(--text); animation: tileIn var(--dur-3) var(--ease-out) both; }
.binder-card:hover .binder-cover { transform: translateY(-4px) rotate(-.6deg); box-shadow: var(--shadow-3); }
.binder-card__meta { display: flex; flex-direction: column; gap: 4px; }
.binder-card__name { font-weight: 800; font-size: var(--fs-lg); display: flex; align-items: center; gap: 8px; }
.binder-card__name svg { width: 16px; height: 16px; color: var(--warning); }
.binder-card__info { font-size: var(--fs-xs); color: var(--text-2); display: flex; gap: 10px; flex-wrap: wrap; }

.binder-cover {
  --binder-color: #3a2a4a;
  position: relative; aspect-ratio: 0.78; border-radius: 10px 18px 18px 10px;
  background:
    linear-gradient(90deg, rgba(0,0,0,.45) 0 9%, rgba(255,255,255,.06) 9% 10%, transparent 10%),
    linear-gradient(150deg, color-mix(in srgb, var(--binder-color) 85%, #fff 15%), var(--binder-color) 45%, color-mix(in srgb, var(--binder-color) 70%, #000 30%));
  box-shadow: var(--shadow-2), inset 0 0 0 1px rgba(255,255,255,.06);
  transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-3);
  overflow: hidden; display: grid; place-items: center;
}
.binder-cover[data-style="couro"] { background:
    linear-gradient(90deg, rgba(0,0,0,.5) 0 9%, rgba(255,255,255,.05) 9% 10%, transparent 10%),
    repeating-radial-gradient(circle at 30% 40%, rgba(0,0,0,.06) 0 2px, transparent 2px 5px),
    linear-gradient(150deg, color-mix(in srgb, var(--binder-color) 80%, #fff 20%), var(--binder-color) 50%, color-mix(in srgb, var(--binder-color) 60%, #000 40%)); }
.binder-cover[data-style="holo"] { background:
    linear-gradient(90deg, rgba(0,0,0,.45) 0 9%, transparent 10%),
    linear-gradient(115deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.22) 45%, rgba(255,255,255,0) 60%),
    conic-gradient(from 210deg at 70% 40%, #9E79BC, #6fb3c9, #d8bde5, #e58aa6, #9E79BC); }
.binder-cover[data-style="noturno"] { background:
    linear-gradient(90deg, rgba(0,0,0,.55) 0 9%, transparent 10%),
    radial-gradient(60% 50% at 70% 30%, rgba(229,138,166,.35), transparent 70%),
    radial-gradient(circle at 70% 30%, #08060b 0 26%, transparent 27%),
    linear-gradient(160deg, color-mix(in srgb, var(--binder-color) 70%, #000), #0b0910); }
.binder-cover__art { position: absolute; inset: 14% 12% 14% 20%; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.binder-cover__art img, .binder-cover__art .tcg { width: 100%; height: 100%; object-fit: cover; }
.binder-cover__title { position: absolute; left: 16%; right: 8%; bottom: 8%; font-family: var(--font-display); font-weight: 700; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.6); font-size: 1.15rem; line-height: 1.1; }
.binder-cover__type { position: absolute; top: 8px; right: 8px; z-index: 2; }
.binder-cover__rings { position: absolute; left: 3%; top: 18%; bottom: 18%; display: flex; flex-direction: column; justify-content: space-between; }
.binder-cover__rings span { width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #8a8590 60%, #4a4550); box-shadow: 0 1px 2px rgba(0,0,0,.5); }

/* ---------------- Fichário: visualização ---------------- */
.binder-shell { --binder-color: #3a2a4a; --sheet-color: #1a1420; --slot-style: rounded; }
.binder-toolbar { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; margin-bottom: var(--sp-4); }
.binder-toolbar .spacer { flex: 1; }
.page-nav { display: inline-flex; align-items: center; gap: 6px; }
.page-nav__label { min-width: 110px; text-align: center; font-weight: 700; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.binder-stage { position: relative; display: grid; place-items: center; padding: var(--sp-6) 0 var(--sp-4); perspective: 2200px; touch-action: pan-y; }

.book {
  position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0;
  padding: 18px; border-radius: 16px 22px 22px 16px;
  background:
    linear-gradient(90deg, transparent calc(50% - 16px), rgba(0,0,0,.55) calc(50% - 2px), rgba(255,255,255,.08) 50%, rgba(0,0,0,.5) calc(50% + 2px), transparent calc(50% + 16px)),
    linear-gradient(150deg, color-mix(in srgb, var(--binder-color) 80%, #fff 20%), var(--binder-color) 45%, color-mix(in srgb, var(--binder-color) 65%, #000 35%));
  box-shadow: var(--shadow-3), inset 0 0 0 1px rgba(255,255,255,.07);
  /* O livro aberto cabe inteiro na altura da tela (proporção ~1,4:1 para páginas 3×3). */
  width: min(100%, 900px, calc((100dvh - 200px) * 1.4));
  transform-style: preserve-3d;
}
.book--single { grid-template-columns: minmax(0, 1fr); width: min(100%, 500px, calc((100dvh - 200px) * .72)); border-radius: 12px 20px 20px 12px; }
@media (max-width: 767px) { .book--single { width: 100%; } }
.sheet--cover-inner { background: linear-gradient(150deg, color-mix(in srgb, var(--binder-color) 70%, #000 30%), color-mix(in srgb, var(--binder-color) 45%, #000 55%)) !important; color: rgba(255,255,255,.45); letter-spacing: .14em; text-transform: uppercase; font-size: var(--fs-xs); font-weight: 700; }
.book--single::before { content: ""; position: absolute; left: 6px; top: 12%; bottom: 12%; width: 6px; border-radius: 4px; background: repeating-linear-gradient(180deg, transparent 0 18%, rgba(255,255,255,.5) 18% 21%, transparent 21% 33%); opacity: .6; }
.sheet {
  position: relative; padding: clamp(10px, 1.6vw, 18px); border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(0,0,0,.08)),
    var(--sheet-color);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), inset 0 0 40px rgba(0,0,0,.35);
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.book:not(.book--single) .sheet:first-child { border-radius: 8px 2px 2px 8px; box-shadow: inset -22px 0 30px -18px rgba(0,0,0,.65), inset 0 0 0 1px rgba(255,255,255,.05); }
.book:not(.book--single) .sheet:last-child { border-radius: 2px 8px 8px 2px; box-shadow: inset 22px 0 30px -18px rgba(0,0,0,.65), inset 0 0 0 1px rgba(255,255,255,.05); }
.sheet__label { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: rgba(255,255,255,.55); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.sheet--light .sheet__label { color: rgba(0,0,0,.5); }
.sheet__grid { display: grid; gap: clamp(5px, .9vw, 10px); grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.sheet--blank { display: grid; place-items: center; color: rgba(255,255,255,.35); font-size: var(--fs-sm); min-height: 200px; }

.pocket {
  position: relative; aspect-ratio: var(--card-ratio); border-radius: 5px;
  background: var(--slot-empty);
  border: 0; padding: 0; cursor: default; display: block; width: 100%; color: inherit;
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2);
  isolation: isolate;
}
.pocket::after { /* plástico protetor */
  content: ""; position: absolute; inset: -2px; border-radius: 6px; pointer-events: none; z-index: 5;
  background: linear-gradient(125deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,0) 28%, rgba(255,255,255,0) 62%, rgba(255,255,255,.08) 80%, rgba(255,255,255,0) 100%);
  box-shadow: inset 0 0 0 1px var(--binder-sleeve-edge);
}
/* estilos dos bolsos: arredondado (padrão), reto e brilho espectral */
.pocket[data-slot-style="rounded"], .pocket[data-slot-style="rounded"] .tcg { border-radius: 10px; }
.pocket[data-slot-style="rounded"]::after { border-radius: 11px; }
.pocket[data-slot-style="square"], .pocket[data-slot-style="square"]::after, .pocket[data-slot-style="square"] .tcg { border-radius: 0; }
.pocket[data-slot-style="glow"], .pocket[data-slot-style="glow"] .tcg { border-radius: 7px; }
.pocket[data-slot-style="glow"]::after { border-radius: 8px; box-shadow: inset 0 0 0 1.5px rgba(216,189,229,.7), 0 0 14px 1px rgba(180,143,224,.55); }
.sheet--light .pocket[data-slot-style="glow"]::after { box-shadow: inset 0 0 0 1.5px rgba(122,79,163,.65), 0 0 12px 1px rgba(122,79,163,.4); }
.pocket .tcg { border-radius: 4px; position: absolute; inset: 0; width: 100%; height: 100%; box-shadow: none; }
.pocket--empty { background: repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 8px, transparent 8px 16px), var(--slot-empty); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.pocket__empty-num { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.22); font-weight: 800; font-size: clamp(.7rem, 1.4vw, 1rem); }
.sheet--light .pocket__empty-num { color: rgba(0,0,0,.22); }
.pocket--ghost .tcg { filter: grayscale(.9) brightness(.62) contrast(.9); opacity: .75; }
.pocket--ghost::before { content: ""; position: absolute; inset: 3px; border: 1.5px dashed rgba(216,189,229,.7); border-radius: 4px; z-index: 6; pointer-events: none; }
.pocket__tag { position: absolute; left: 4px; bottom: 4px; z-index: 7; display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 99px; font-size: 9.5px; font-weight: 800; background: rgba(13,11,18,.86); color: #F3EDF4; border: 1px solid rgba(216,189,229,.3); max-width: calc(100% - 8px); }
.pocket__tag svg { width: 10px; height: 10px; flex: none; }
.pocket__tag--ghost { color: #D8BDE5; }
.pocket__tag--virtual { color: #9ccbe8; }
.pocket__tag--image { color: #e9b872; }
.pocket__lock { position: absolute; right: 4px; top: 4px; z-index: 7; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; background: rgba(167,61,94,.95); color: #fff; }
.pocket__lock svg { width: 11px; height: 11px; }
.pocket.is-locked { box-shadow: 0 0 0 1.5px rgba(167,61,94,.85); }
.pocket__image { position: absolute; inset: 0; border-radius: 4px; background-repeat: no-repeat; background-color: #0d0b12; overflow: hidden; }
.is-editing .pocket { cursor: pointer; }
.is-editing .pocket:hover { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--primary); z-index: 2; }
.pocket.is-selected { box-shadow: 0 0 0 3px var(--primary), 0 0 18px rgba(158,121,188,.6); z-index: 3; }
.pocket.is-origin { box-shadow: 0 0 0 3px var(--crimson), 0 0 18px rgba(167,61,94,.6); animation: pulse 1.2s ease-in-out infinite; }
.pocket.is-drop { box-shadow: 0 0 0 3px var(--success); transform: scale(1.03); }
.pocket.is-dragging { opacity: .4; }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px var(--crimson), 0 0 4px rgba(167,61,94,.2); } }
.view-only .pocket--filled { cursor: zoom-in; }

/* Virada de página */
.leaf {
  position: absolute; top: 18px; bottom: 18px; width: calc(50% - 18px); left: 50%;
  transform-origin: left center; transform-style: preserve-3d; z-index: 20; pointer-events: none;
}
.leaf--back { left: 18px; transform-origin: right center; }
.leaf__face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 4px; overflow: hidden; }
.leaf__face--back { transform: rotateY(180deg); }
.leaf__face .sheet { height: 100%; }
.leaf.is-turning-next { animation: turnNext var(--dur-4) var(--ease-in-out) forwards; }
.leaf.is-turning-prev { animation: turnPrev var(--dur-4) var(--ease-in-out) forwards; }
@keyframes turnNext { from { transform: rotateY(0deg); } to { transform: rotateY(-180deg); } }
@keyframes turnPrev { from { transform: rotateY(0deg); } to { transform: rotateY(180deg); } }
.leaf::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0,0,0,.35), transparent 40%); opacity: 0; animation: leafShade var(--dur-4) ease forwards; }
@keyframes leafShade { 50% { opacity: 1; } 100% { opacity: 0; } }

.binder-side { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--sp-5); align-items: start; }
@media (max-width: 1100px) { .binder-side { grid-template-columns: minmax(0, 1fr); } }
.editor-panel { position: sticky; top: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-4); }
.legend { display: grid; gap: 8px; font-size: var(--fs-xs); color: var(--text-2); }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 18px; border-radius: 3px; display: inline-block; flex: none; }
.page-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; }
.page-thumb { flex: none; width: 64px; border-radius: 6px; padding: 5px; background: var(--sheet-color); border: 2px solid transparent; cursor: pointer; display: grid; gap: 2px; grid-template-columns: repeat(var(--cols, 3), 1fr); }
.page-thumb[aria-current="true"] { border-color: var(--primary); }
.page-thumb i { aspect-ratio: var(--card-ratio); border-radius: 1px; background: rgba(255,255,255,.08); }
.page-thumb i.f { background: var(--primary); opacity: .8; }
.page-thumb i.g { background: rgba(216,189,229,.35); }
.page-thumb i.m { background: #e9b872; opacity: .7; }
.page-thumb__n { grid-column: 1 / -1; font-size: 9px; color: rgba(255,255,255,.6); text-align: center; font-weight: 700; }

@media (max-width: 767px) {
  .book { padding: 10px; border-radius: 10px 14px 14px 10px; }
  .binder-stage { padding-top: var(--sp-3); }
  .page-nav__label { min-width: 80px; }
}

/* Editor de recorte e panorama */
.crop-stage { position: relative; width: min(300px, 70vw); aspect-ratio: var(--card-ratio); margin: 0 auto; border-radius: 10px; overflow: hidden; background: #0d0b12; touch-action: none; cursor: grab; box-shadow: 0 0 0 1px var(--border-2), var(--shadow-2); }
.crop-stage:active { cursor: grabbing; }
.crop-stage__img { position: absolute; inset: 0; background-repeat: no-repeat; }
.crop-stage__guide { position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(90deg, transparent calc(33.33% - .5px), rgba(255,255,255,.25) 33.33%, transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255,255,255,.25) 66.66%, transparent calc(66.66% + .5px)),
  linear-gradient(180deg, transparent calc(33.33% - .5px), rgba(255,255,255,.25) 33.33%, transparent calc(33.33% + .5px), transparent calc(66.66% - .5px), rgba(255,255,255,.25) 66.66%, transparent calc(66.66% + .5px)); }

.pano-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--sp-6); align-items: start; }
@media (max-width: 1000px) { .pano-layout { grid-template-columns: minmax(0, 1fr); } }
.pano-stage-wrap { display: grid; place-items: center; padding: var(--sp-5); background: var(--bg-2); border-radius: var(--r-lg); border: 1px solid var(--border); }
.pano-stage { position: relative; touch-action: none; cursor: grab; overflow: hidden; border-radius: 6px; background: #0d0b12; box-shadow: var(--shadow-2); }
.pano-stage:active { cursor: grabbing; }
.pano-stage__img { position: absolute; inset: 0; background-repeat: no-repeat; }
.pano-stage__grid { position: absolute; inset: 0; display: grid; pointer-events: none; }
.pano-stage__grid span { box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
.pano-stage__grid span:nth-child(odd) { box-shadow: inset 0 0 0 1px rgba(255,255,255,.55), inset 0 0 0 9999px rgba(0,0,0,0); }
.pano-gap { position: absolute; background: var(--bg-2); }
.pano-tiles { display: grid; gap: 6px; }
.pano-tiles .pocket::after { display: none; }
.dpi-ok { color: var(--success); } .dpi-warn { color: var(--warning); } .dpi-bad { color: var(--danger); }

/* Biblioteca de imagens */
.asset-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.asset { position: relative; border-radius: var(--r-md); overflow: hidden; background: var(--bg-2); border: 1px solid var(--border); cursor: pointer; text-align: left; padding: 0; color: var(--text); }
.asset img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.asset__meta { padding: 8px 10px; font-size: var(--fs-xs); color: var(--text-2); }
.asset__meta strong { display: block; color: var(--text); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--primary); }

/* ---------------- Carta: detalhe ---------------- */
.card-detail { display: grid; grid-template-columns: minmax(240px, 380px) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: start; }
.card-detail__art { position: sticky; top: var(--sp-6); }
@media (max-width: 760px) { .card-detail { grid-template-columns: minmax(0, 1fr); } .card-detail__art { position: static; max-width: 320px; margin: 0 auto; width: 100%; } }
.card-detail__art .tcg { box-shadow: var(--shadow-3), 0 0 60px -20px var(--primary); cursor: zoom-in; }
.card-detail h1 { font-family: var(--font-display); font-size: var(--fs-3xl); font-weight: 600; }
.attr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-3); }
.attr { padding: 12px 14px; border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--border); }
.attr dt { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); font-weight: 700; }
.attr dd { margin: 4px 0 0; font-weight: 700; }
.attack { padding: 12px 14px; border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--border); }
.attack__head { display: flex; justify-content: space-between; gap: var(--sp-3); font-weight: 700; }
.attack p { color: var(--text-2); font-size: var(--fs-sm); margin-top: 4px; }

.zoom-view { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: rgba(5,4,8,.88); backdrop-filter: blur(6px); animation: fadeIn var(--dur-2) ease both; cursor: zoom-out; padding: var(--sp-6); }
.zoom-view .tcg { width: min(460px, 86vw); box-shadow: 0 30px 90px rgba(0,0,0,.7), 0 0 80px -10px rgba(158,121,188,.6); animation: zoomIn var(--dur-3) var(--ease-out) both; }
@keyframes zoomIn { from { transform: scale(.88) rotateY(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- Catálogo ---------------- */
.catalog-head { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.catalog-search { position: relative; }
.catalog-search .input { height: 52px; font-size: var(--fs-lg); padding-left: 48px; border-radius: var(--r-md); }
.catalog-search > svg { position: absolute; left: 16px; top: 16px; width: 20px; height: 20px; color: var(--text-3); }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r-md); box-shadow: var(--shadow-3); padding: 6px; }
.suggest button { width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--text); display: flex; gap: 10px; align-items: center; }
.suggest button:hover, .suggest button[aria-selected="true"] { background: var(--primary-soft); }
.suggest button svg { width: 15px; height: 15px; color: var(--text-3); }
.filters { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: var(--sp-4); border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--border); }
.filters .field__label { font-size: var(--fs-xs); color: var(--text-2); }
.set-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.set-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); cursor: pointer; text-align: left; color: var(--text); transition: border-color var(--dur-2), transform var(--dur-2); }
.set-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.set-card__logo { height: 54px; display: grid; place-items: center; }
.set-card__logo img { max-height: 54px; max-width: 100%; object-fit: contain; }
.set-card__logo span { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--text-2); text-align: center; }
.set-card__name { font-weight: 700; font-size: var(--fs-sm); }
.set-card__meta { font-size: var(--fs-xs); color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.set-card__meta img { width: 16px; height: 16px; object-fit: contain; }
.serie-block { margin-bottom: var(--sp-8); }
.serie-block h2 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; margin-bottom: var(--sp-3); }

/* ---------------- Coleção ---------------- */
.locs { display: flex; flex-direction: column; gap: 6px; }
.loc-line { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border); font-size: var(--fs-sm); }
.loc-line svg { width: 16px; height: 16px; color: var(--primary); flex: none; }
.loc-line .grow { min-width: 0; }
@media (max-width: 600px) { .loc-line { flex-wrap: wrap; row-gap: 8px; } .loc-line .grow { flex-basis: calc(100% - 30px); } }

/* ---------------- Decks ---------------- */
.deck-cards { display: grid; gap: var(--sp-5); grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.deck-card { border-radius: var(--r-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--border); text-decoration: none !important; color: var(--text); display: flex; flex-direction: column; transition: transform var(--dur-3) var(--ease-out), border-color var(--dur-2); animation: tileIn var(--dur-3) var(--ease-out) both; }
.deck-card:hover { transform: translateY(-3px); border-color: var(--border-2); }
.deck-card__art { height: 140px; position: relative; overflow: hidden; background: radial-gradient(60% 80% at 70% 30%, rgba(167,61,94,.35), transparent 70%), linear-gradient(140deg, #201827, #0d0b12); }
.deck-card__art .tcg { position: absolute; width: 96px; top: 18px; box-shadow: var(--shadow-2); }
.deck-card__art .tcg:nth-child(1) { left: 24%; transform: rotate(-12deg); }
.deck-card__art .tcg:nth-child(2) { left: 38%; transform: rotate(0deg); z-index: 2; }
.deck-card__art .tcg:nth-child(3) { left: 52%; transform: rotate(12deg); }
.deck-card__body { padding: var(--sp-4); display: flex; flex-direction: column; gap: 8px; }
.deck-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: var(--sp-6); align-items: start; }
.deck-layout--narrow-aside { grid-template-columns: minmax(0, 1fr) 360px; }
@media (max-width: 1150px) { .deck-layout { grid-template-columns: minmax(0, 1fr); } }
.deck-list { display: flex; flex-direction: column; gap: var(--sp-4); }
.deck-group h3 { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .12em; color: var(--text-2); margin-bottom: 6px; display: flex; justify-content: space-between; }
.deck-line { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; }
.deck-line:hover { background: var(--primary-soft); }
.deck-line .tcg { width: 34px; border-radius: 3px; }
.deck-line__name { font-weight: 700; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-line__own { font-size: 11px; color: var(--text-2); display: flex; gap: 8px; flex-wrap: wrap; }
.deck-line__own .ok { color: var(--success); } .deck-line__own .miss { color: var(--danger); } .deck-line__own .res { color: var(--warning); }
.deck-sticky { position: sticky; top: var(--sp-4); }
.validity { display: grid; gap: 8px; }
.validity__item { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); }
.validity__item svg { width: 16px; height: 16px; flex: none; margin-top: 3px; }
.validity__item--ok svg { color: var(--success); } .validity__item--bad svg { color: var(--danger); } .validity__item--unknown svg { color: var(--warning); }
.steps { display: flex; gap: 6px; margin-bottom: var(--sp-5); flex-wrap: wrap; }
.steps span { flex: 1 1 100px; height: 4px; border-radius: 99px; background: var(--surface-3); }
.steps span.is-done { background: linear-gradient(90deg, var(--primary), var(--crimson)); }

/* ---------------- Perfil / Comunidade ---------------- */
.profile-banner { height: clamp(150px, 22vw, 240px); border-radius: var(--r-xl); position: relative; overflow: hidden; background-size: cover; background-position: 50% 40%;
  background-image: url("../assets/art/sky-dark.webp"); background-color: #15111D;
}
:root[data-theme="light"] .profile-banner { background-image: url("../assets/art/sky-light.webp"); background-color: #E1D6EB; }
.profile-banner__eclipse { display: none; position: absolute; right: 8%; top: -50%; width: 46%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #09070c 60%, transparent 71%); box-shadow: inset -12px 10px 40px -12px rgba(229,138,166,.6); }
.profile-head { display: flex; align-items: flex-start; gap: var(--sp-3) var(--sp-5); margin-top: -56px; padding: 0 var(--sp-6); position: relative; flex-wrap: wrap; }
/* Nome e ações começam abaixo do banner; só o avatar se sobrepõe a ele. */
.profile-head > :not(.avatar) { margin-top: 68px; }
@media (max-width: 640px) { .profile-head > :not(.avatar) { margin-top: 0; flex-basis: 100%; } }
.avatar { width: 112px; height: 112px; border-radius: 50%; border: 4px solid var(--bg); background: linear-gradient(135deg, #9E79BC, #A73D5E); display: grid; place-items: center; font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; color: #fff; overflow: hidden; flex: none; box-shadow: var(--shadow-2); background-size: cover; background-position: center; }
.avatar--sm { width: 40px; height: 40px; border-width: 0; font-size: 1rem; box-shadow: none; }
.avatar--md { width: 56px; height: 56px; border-width: 2px; font-size: 1.4rem; }
.profile-head__info { flex: 1; min-width: 220px; }
.profile-head__info h1 { line-height: 1.1; }
.profile-head__info h1 { font-family: var(--font-display); font-size: 2.2rem; font-weight: 600; }
.profile-stats { display: flex; gap: var(--sp-6); flex-wrap: wrap; margin-top: var(--sp-4); }
.feed { display: flex; flex-direction: column; gap: var(--sp-4); }
.post { padding: var(--sp-5); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--sp-3); animation: tileIn var(--dur-3) var(--ease-out) both; }
.post__head { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.post__author { font-weight: 700; }
.post__time { font-size: var(--fs-xs); color: var(--text-3); }
.post__cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; max-width: 480px; }
.post__actions { display: flex; gap: var(--sp-2); }
.like-btn[aria-pressed="true"] { color: var(--crimson-text); }
.like-btn[aria-pressed="true"] svg { fill: currentColor; }
.collector { display: flex; gap: var(--sp-3); align-items: center; padding: 10px; border-radius: var(--r-md); }
.collector:hover { background: var(--primary-soft); }
.community-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-6); align-items: start; }
@media (max-width: 1050px) { .community-layout { grid-template-columns: minmax(0, 1fr); } }

/* ---------------- Objetivos ---------------- */
.goal-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-4); align-items: center; padding: var(--sp-4); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); }
.gen-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ---------------- Configurações ---------------- */
.settings-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--sp-6); align-items: start; }
@media (max-width: 860px) { .settings-grid { grid-template-columns: minmax(0, 1fr); } }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: var(--sp-4); }
@media (max-width: 860px) { .settings-nav { flex-direction: row; overflow-x: auto; position: static; } }
.setting { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); padding: var(--sp-4) 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.setting:last-child { border-bottom: 0; }
.setting__text { flex: 1; min-width: 220px; }
.setting__text strong { display: block; }
.setting__text span { font-size: var(--fs-sm); color: var(--text-2); }
.mode-option { display: flex; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--r-md); border: 1.5px solid var(--border-2); cursor: pointer; background: var(--bg-2); }
.mode-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.mode-option input { accent-color: var(--primary); margin-top: 4px; }

/* ---------------- Impressão (janela de exportação) ---------------- */
.print-sheet { background: #fff; }

/* 404 */
.notfound { min-height: 70dvh; display: grid; place-items: center; text-align: center; }
.notfound h1 { font-family: var(--font-display); font-size: 5rem; font-weight: 600; color: var(--primary); }

/* Placeholder compacto dentro dos bolsos */
.pocket .tcg__fallback { padding: 10% 9%; }
.pocket .tcg__fallback-meta { display: none; }
.pocket .tcg__fallback-name { font-size: clamp(.62rem, 9cqw, 1rem); }
.pocket .tcg__fallback-star { width: 40%; }

/* Inventário */
.inventory-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.inventory-tree { padding: 12px; position: sticky; top: 16px; max-height: calc(100dvh - 32px); overflow: auto; }
@media (max-width: 900px) { .inventory-layout { grid-template-columns: minmax(0, 1fr); } .inventory-tree { position: static; max-height: 320px; } }

/* Barra de busca do catálogo: quebra em duas linhas no celular */
.catalog-bar { display: flex; gap: var(--sp-3); align-items: stretch; }
.catalog-bar__lang { width: auto; height: 52px; }
@media (max-width: 767px) {
  .catalog-bar { flex-wrap: wrap; }
  .catalog-bar .catalog-search { flex: 1 1 100%; }
  .catalog-bar__lang { flex: 1 1 0; min-width: 0; }
}

/* Cabeçalho de página com arte (Fichários, Decks, Comunidade). Texto claro sobre a arte escura. */
.page-head--art { position: relative; isolation: isolate; overflow: hidden; border-radius: var(--r-xl); padding: clamp(24px, 3.5vw, 44px) clamp(20px, 3vw, 40px); min-height: 210px; align-items: flex-end; color: #F3EDF4; border: 1px solid rgba(216,189,229,.12); background: #15111D; }
.page-head--art::before { content: ""; position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: 50% 50%; }
.page-head--art::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(12,10,16,.9) 0%, rgba(12,10,16,.62) 45%, rgba(12,10,16,.12) 100%); }
.page-head--art[data-art="binders"]::before { background-image: url("../assets/art/binders.webp"); background-position: 60% 50%; }
.page-head--art[data-art="decks"]::before { background-image: url("../assets/art/decks.webp"); background-position: 60% 60%; }
.page-head--art[data-art="inventory"]::before { background-image: url("../assets/art/inventory.webp"); background-position: 50% 42%; }
.page-head--art[data-art="universe"]::before { background-image: url("../assets/art/universe.webp"); background-position: 50% 38%; }
.page-head--art[data-art="community"]::before { background-image: url("../assets/art/community.webp"); background-position: 70% 50%; }
.page-head--art .page-head__eyebrow { color: #E5C9F0; }
.page-head--art p { color: #D6CBDD; }
.page-head--art .field__label { color: #E5C9F0; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.page-head--art .btn:not(.btn--primary) { --btn-bg: rgba(20,15,26,.55); --btn-fg: #F3EDF4; --btn-bd: rgba(216,189,229,.3); backdrop-filter: blur(6px); }
@media (max-width: 767px) { .page-head--art { min-height: 180px; } .page-head--art::after { background: linear-gradient(180deg, rgba(12,10,16,.35) 0%, rgba(12,10,16,.88) 75%); } }

/* Telas baixas: a tela de entrada aperta os espaços para caber sem rolagem */
@media (min-width: 1024px) and (max-height: 760px) {
  .welcome__panel { gap: var(--sp-2); padding-top: var(--sp-3); }
  .welcome__card { gap: var(--sp-2); }
  .welcome__title { font-size: 1.6rem; }
  .welcome__form { gap: var(--sp-2); }
  .welcome .field { gap: 4px; }
}

/* ---------- Visualização sem marcações ----------
   Fora do modo de edição, os bolsos mostram só as cartas e artes: sem selos, cadeados ou números.
   Cartas fantasmas continuam reconhecíveis pela borda tracejada discreta. */
.view-only .pocket__tag, .view-only .pocket__lock, .view-only .pocket__empty-num { display: none; }
.view-only .pocket.is-locked { box-shadow: none; }
.view-only .pocket--ghost::before { border-color: rgba(216,189,229,.35); }

/* ---------- Modo espectador (tela cheia) ---------- */
html.dd-noscroll, html.dd-noscroll body { overflow: hidden; }
.is-spectator .binder-stage {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
  padding: calc(64px + var(--safe-top)) clamp(64px, 7vw, 120px) calc(64px + var(--safe-bottom));
  background: radial-gradient(70% 60% at 50% 45%, #1c1427 0%, #0b0910 70%), #0b0910;
}
.spectate-enter .binder-stage { animation: spectateIn var(--dur-4) var(--ease-out) backwards; }
@keyframes spectateIn { from { opacity: 0; } to { opacity: 1; } }
.is-spectator .book { width: min(100%, calc((100dvh - 150px) * 1.4)); }
.is-spectator .book--single { width: min(100%, calc((100dvh - 150px) * .72)); }
.spectate-ui__close {
  position: fixed; top: calc(16px + var(--safe-top)); right: 16px; z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid rgba(216,189,229,.25); background: rgba(20,15,26,.7); color: #F3EDF4; cursor: pointer;
}
.spectate-ui__nav {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid rgba(216,189,229,.2); background: rgba(20,15,26,.55); color: #F3EDF4; cursor: pointer;
  transition: background var(--dur-2), opacity var(--dur-2);
}
.spectate-ui__nav--prev { left: clamp(10px, 2vw, 32px); }
.spectate-ui__nav--next { right: clamp(10px, 2vw, 32px); }
.spectate-ui__nav:hover:not([disabled]), .spectate-ui__close:hover { background: rgba(158,121,188,.3); }
.spectate-ui__nav[disabled] { opacity: .25; cursor: default; }
.spectate-ui__nav svg, .spectate-ui__close svg { width: 22px; height: 22px; }
.spectate-ui__label {
  position: fixed; left: 50%; bottom: calc(18px + var(--safe-bottom)); transform: translateX(-50%); z-index: 2;
  display: flex; gap: 10px; align-items: baseline; color: #CFC3D8; font-size: var(--fs-sm); white-space: nowrap;
}
.spectate-ui__label strong { font-family: var(--font-display); font-size: 1.1rem; color: #F3EDF4; font-weight: 600; }
@media (max-width: 767px) {
  .is-spectator .binder-stage { padding: calc(60px + var(--safe-top)) 8px calc(70px + var(--safe-bottom)); }
  .spectate-ui__nav { top: auto; bottom: calc(12px + var(--safe-bottom)); transform: none; }
  .spectate-ui__label { bottom: calc(26px + var(--safe-bottom)); }
  .spectate-ui__label strong { display: none; }
}

/* ---------- Editor de recorte ---------- */
.dpi-ok svg, .dpi-warn svg, .dpi-bad svg { width: 15px; height: 15px; vertical-align: -3px; flex: none; }
.cropper { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: var(--sp-5); align-items: start; }
.cropper__viewport {
  position: relative; height: min(58vh, 500px); border-radius: var(--r-md); overflow: hidden; touch-action: none; cursor: grab;
  display: grid; place-items: center; outline: none;
  background: repeating-conic-gradient(#17121e 0% 25%, #120e18 0% 50%) 50% / 22px 22px;
}
.cropper__viewport.is-dragging { cursor: grabbing; }
.cropper__viewport:focus-visible { box-shadow: inset 0 0 0 2px var(--border-focus); }
.cropper__frame { position: relative; overflow: visible; }
.cropper__frame img { user-select: none; pointer-events: none; }
/* A janela da carta: tudo fora dela fica escurecido, mas visível para dar contexto. */
.cropper__mask {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none;
  width: var(--fw, 0); height: var(--fh, 0); border-radius: 4.6% / 3.3%;
  box-shadow: 0 0 0 9999px rgba(8, 6, 12, .66), inset 0 0 0 2px rgba(216,189,229,.85);
}
.cropper__side { display: flex; flex-direction: column; gap: var(--sp-4); }
.cropper__preview { position: relative; width: 120px; aspect-ratio: var(--card-ratio); border-radius: 4.6% / 3.3%; overflow: hidden; background: #0d0b12; box-shadow: var(--shadow-2); margin-top: 6px; }
.cropper__zoom { display: flex; align-items: center; gap: var(--sp-2); }
.cropper__zoom input { flex: 1; min-width: 0; }
.dpi-pill { display: grid; gap: 4px; }
.dpi-pill__badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: var(--fs-sm); }
@media (max-width: 720px) {
  .cropper { grid-template-columns: minmax(0, 1fr); }
  .cropper__viewport { height: min(46vh, 380px); }
  .cropper__preview-wrap { display: none; }
}

/* ---------- Editor panorâmico: proporções contidas ---------- */
.pano-stage-wrap { min-height: 0; }
.pano-dpi { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; }
.pano-dpi svg, .pano-ok svg { width: 15px; height: 15px; flex: none; }
.pano-ok { display: flex; align-items: flex-start; gap: 6px; color: var(--success); }
.pano-ok svg { margin-top: 1px; }
.pano-picker { max-width: 240px; width: 100%; margin-inline: auto; }
.pano-tiles { justify-content: start; }

/* ---------- Substituir conteúdo do bolso ---------- */
.replace-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.replace-opt {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px;
  border: 1px solid var(--border-2); border-radius: var(--r-md); background: var(--surface-2); color: var(--text);
  cursor: pointer; transition: border-color var(--dur-2), background var(--dur-2);
}
.replace-opt:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); }
.replace-opt:disabled { opacity: .45; cursor: not-allowed; }
.replace-opt > svg { width: 22px; height: 22px; color: var(--primary); flex: none; }
.replace-opt span { display: grid; gap: 2px; }
.replace-opt small { color: var(--text-3); font-size: var(--fs-xs); }

/* =========================================================
   Comunidade (posts, comentários, perfis)
   ========================================================= */
.post__body { white-space: pre-line; overflow-wrap: anywhere; margin: 0; }
.post__head .avatar, .collector .avatar, .comment .avatar { flex: none; }
.avatar--xs { width: 26px; height: 26px; border-width: 0; font-size: .7rem; box-shadow: none; }
.post__binder {
  display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: var(--r-md);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-decoration: none; max-width: 460px;
}
.post__binder:hover { border-color: var(--primary); }
.post__binder > .binder-cover { width: 92px; flex: none; }
.post__binder > span { display: grid; gap: 4px; min-width: 0; }
.post__deck-art { width: 64px; flex: none; display: grid; place-items: center; color: var(--primary); }
.post__deck-art > svg { width: 30px; height: 30px; }
.comments { border-top: 1px solid var(--border); padding-top: var(--sp-3); display: grid; gap: var(--sp-3); }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment p { margin: 2px 0 0; white-space: pre-line; overflow-wrap: anywhere; font-size: var(--fs-sm); }
.comment__author { font-weight: 700; color: var(--text); font-size: var(--fs-sm); }
.comment-form { display: flex; gap: 8px; }
.comment-form .input { flex: 1; min-width: 0; }
.icon-btn--sm { width: 30px; height: 30px; }
.icon-btn--sm svg { width: 15px; height: 15px; }
.composer textarea { min-height: 90px; }
.composer__attach { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.stat--btn { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: inherit; text-decoration: none; font: inherit; }
.stat--btn:hover .stat__value { color: var(--primary); }
.deck-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.deck-chip { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; }
.deck-chip:hover { border-color: var(--primary); }
.deck-chip > span { display: grid; gap: 2px; min-width: 0; }
.deck-chip__art { width: 52px; flex: none; display: grid; place-items: center; color: var(--primary); }
.deck-line__qty { font-size: 1.05rem; color: var(--primary); }

/* contador do menu (trocas pendentes) e sino da barra superior */
.nav__item[data-badge]:not([data-badge=""])::after {
  content: attr(data-badge); margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--crimson); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center;
}
.topbar__notif { position: relative; }
.topbar__notif .nav__badge { position: absolute; top: 2px; right: 0; margin: 0; }

/* =========================================================
   Trocas
   ========================================================= */
.trade { display: grid; gap: var(--sp-4); }
.trade__head { display: flex; gap: 12px; align-items: center; }
.trade__head a { color: var(--text); }
.trade__msg { margin: 0; padding: 10px 14px; border-left: 3px solid var(--primary); background: var(--primary-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; white-space: pre-line; }
.trade__sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }
@media (max-width: 760px) { .trade__sides { grid-template-columns: minmax(0, 1fr); } }
.trade__label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); margin: 0 0 10px; }
.trade__label svg { width: 16px; height: 16px; color: var(--primary); }
.trade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.trade-grid--pick { max-height: 560px; overflow: auto; padding: 4px; }
.trade-card { position: relative; display: grid; gap: 6px; }
.trade-card__meta { font-size: var(--fs-xs); line-height: 1.35; overflow-wrap: anywhere; }
.trade-card.is-selected .tcg { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 8px; }
.trade-card.is-unavailable { opacity: .5; }
.trade-card__flag { position: absolute; top: 6px; left: 6px; }
.wish-dot { color: var(--crimson); font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.wish-dot svg { width: 11px; height: 11px; }
.trade-compose { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); align-items: start; }
@media (max-width: 900px) { .trade-compose { grid-template-columns: minmax(0, 1fr); } }
.trade-compose .panel__head { flex-wrap: wrap; gap: 8px; }
.trade-compose .panel__title { gap: 8px; }

/* =========================================================
   Notificações, importação, primeiros passos, conta
   ========================================================= */
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.notif__link { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; }
a.notif__link:hover { border-color: var(--primary); }
.notif.is-unread .notif__link { background: var(--primary-soft); }
.notif__text { display: flex; gap: 6px; align-items: flex-start; }
.notif__text svg { width: 15px; height: 15px; margin-top: 2px; color: var(--primary); flex: none; }
.notif__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--crimson); flex: none; }
.import-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.import-summary .stat { padding: 12px; border-radius: var(--r-md); background: var(--surface-2); }
.onboarding { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-4); border-color: var(--primary); }
.onboarding > div:first-child { flex: 1 1 380px; }
.setting--form { align-items: flex-start; flex-wrap: wrap; }

/* ---------------- Prévia dos bolsos (personalizar fichário) ---------------- */
.appearance-grid { align-items: start; }
.appearance-preview { display: flex; gap: var(--sp-3); align-items: flex-start; }
.appearance-preview__cover { width: 130px; flex: none; }
.slot-preview { width: min(100%, 190px); }
.slot-preview .sheet { padding: 8px; border-radius: 6px; }
.slot-preview .sheet__grid { gap: 5px; }
.slot-preview .pocket__empty-num { font-size: .7rem; }
.slot-preview .pocket { transition: border-radius var(--dur-2) var(--ease-out); }
.slot-preview__card { position: absolute; inset: 0; border-radius: inherit; overflow: hidden;
  background: radial-gradient(120% 80% at 30% 20%, rgba(255,255,255,.22), transparent 55%), linear-gradient(160deg, #6d4c8f, #2c2140 70%); }
.slot-preview__card::after { content: ""; position: absolute; inset: 9% 10% 46%; border-radius: 3px; background: linear-gradient(135deg, rgba(255,255,255,.28), rgba(255,255,255,.06)); box-shadow: 0 0 0 1px rgba(255,255,255,.18); }
.slot-preview__card--1 { background: radial-gradient(120% 80% at 30% 20%, rgba(255,255,255,.22), transparent 55%), linear-gradient(160deg, #c46a4a, #5a2a2a 70%); }
.slot-preview__card--2 { background: radial-gradient(120% 80% at 30% 20%, rgba(255,255,255,.22), transparent 55%), linear-gradient(160deg, #4a8ac4, #1f3354 70%); }

/* ---------------- Perguntas frequentes ---------------- */
.faq__search { margin-bottom: var(--sp-6); }
.faq__section { margin-bottom: var(--sp-8); }
.faq__title { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 600; margin-bottom: var(--sp-3); }
.faq__title svg { width: 20px; height: 20px; color: var(--primary); }
.faq__item { border: 1px solid var(--border); border-radius: var(--r-lg, 14px); background: var(--surface-1, rgba(255,255,255,.02)); margin-bottom: 10px; transition: border-color var(--dur-2); }
.faq__item[open] { border-color: var(--border-2, var(--primary)); }
.faq__item summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; font-weight: 700; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary svg { width: 18px; height: 18px; flex: none; color: var(--text-3, var(--text-2)); transition: transform var(--dur-2) var(--ease-out); }
.faq__item[open] summary svg { transform: rotate(180deg); }
.faq__item summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: inherit; }
.faq__answer { padding: 0 18px 16px; color: var(--text-2); line-height: 1.65; }
.faq__answer p + p, .faq__answer p + ul, .faq__answer ul + p { margin-top: 10px; }
.faq__answer ul { padding-left: 20px; display: grid; gap: 4px; margin-top: 6px; }
.faq__answer strong { color: var(--text); }
.faq__answer a { color: var(--primary); font-weight: 600; }
.faq__more { margin-top: var(--sp-6); }
.card-detail__why { display: inline-block; margin-top: 10px; color: var(--primary); font-weight: 600; }
.site-footer__legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
