/* ----------------------------------------------------------
   Tema BernaCripto SPA — Versão limpa, SEM QUALQUER ANIMAÇÃO
----------------------------------------------------------- */

:root {
  --bg: #0a0e1a;
  --panel: #0f1419;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #00d4aa;
  --accent-secondary: #6366f1;
  --dero-cyan: #00d4aa;
  --dero-purple: #7c3aed;
  --border: #1a1f2e;
}

/* ----------------------------------------------------------
   ESTRUTURA BASE
----------------------------------------------------------- */

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: system-ui, Arial, sans-serif;
  background: linear-gradient(135deg, #0a0e1a 0%, #1a1f2e 50%, #0f1419 100%);
  background-attachment: fixed;
  position: relative;
}

/* Luz suave no fundo */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* blend of radial lights similar to legacy design */
  background:
    radial-gradient(circle at 20% 30%, rgba(0, 212, 170, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 10%, rgba(0, 0, 0, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* SPA structure */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ----------------------------------------------------------
   LINKS
----------------------------------------------------------- */

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--accent-secondary);
}

/* ----------------------------------------------------------
   HEADER / MENU SUPERIOR
----------------------------------------------------------- */

.spa-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
}

.main-nav {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  margin: 0;
  padding: 0;
}

.nav-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.nav-logo img {
  height: 36px;
}

/* small inline emoji/icons used across the dashboard (legacy sizes) */
.emoji { width: 16px; height: 16px; object-fit: contain; vertical-align: middle; }
.chip .emoji { width: 18px; height: 18px; }

/* Wallet input + paste button (legacy look) */
.bar { display: flex; gap: 12px; align-items: center; }
.input-wrapper { position: relative; flex: 1; display: flex; align-items: center; }
.wallet-input { flex: 1; padding: 10px 44px 10px 16px; font-size: 14px; border-radius: 10px; border: 1px solid var(--border); background: rgba(11,18,32,0.9); color: var(--text); outline: none; height:40px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.02); }
.wallet-input::placeholder { color: #64748b; }
.copy-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.2); border-radius: 6px; border: 1px solid var(--border); padding: 6px; cursor: pointer; color: var(--muted); transition: color 0.15s, background 0.15s; }
.copy-btn:hover { color: var(--accent); background: rgba(0,212,170,0.04); }
.copy-btn svg { width: 18px; height: 18px; display: block; }

/* Primary action button (Ver Relatório) */
.btn-primary { margin-left: 6px; cursor: pointer; padding: 8px 16px; border-radius: 10px; border: none; color: #fff; font-weight: 800; background: linear-gradient(135deg, var(--dero-cyan) 0%, var(--dero-purple) 100%); box-shadow: 0 10px 30px rgba(124,58,237,0.08), 0 2px 6px rgba(0,0,0,0.5) inset; height:40px; display:inline-flex; align-items:center; font-size:14px; position:relative; }
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }

/* subtle outer glow like legacy */
.btn-primary::after { content: ''; position: absolute; left: -6px; top: -6px; right: -6px; bottom: -6px; border-radius: 12px; box-shadow: 0 6px 18px rgba(124,58,237,0.06); pointer-events:none; opacity:0.8; }

/* Price card (DERO/USD) */
.price-card { background: linear-gradient(180deg, rgba(17,22,30,0.95), rgba(13,16,20,0.9)); border: 2px solid rgba(0,212,170,0.18); border-radius: 14px; padding: 10px 16px; box-shadow: 0 8px 24px rgba(0,212,170,0.04); display: flex; flex-direction: column; align-items: center; justify-content: center; min-width:140px; text-align: center; }
.price-card strong { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.price-card #priceValue { font-size: 18px; font-weight: 900; color: #fbbf24; }
.price-card { align-self: flex-start; }

/* Small user chip layout already provided; ensure spacing */
.chip { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.02); background: linear-gradient(180deg, rgba(11,18,32,0.95), rgba(8,12,20,0.9)); min-height: 36px; box-shadow: 0 2px 8px rgba(0,0,0,0.45) inset; }

/* HOJE panel: make cards compact and large numbers like legacy */
.summary-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.summary-tile { background: linear-gradient(180deg, rgba(11,18,32,0.95), rgba(9,13,20,0.92)); padding:18px; border-radius:12px; border:1px solid rgba(255,255,255,0.02); text-align:center; box-shadow: 0 6px 18px rgba(0,0,0,0.5) inset; }
.summary-tile strong { font-size:13px; color:var(--muted); margin-bottom:8px; display:flex; align-items:center; justify-content:center; gap:8px; }
.summary-tile .big { font-size:30px; font-weight:800; color: var(--text); }
.summary-tile .big.green { color: #10b981; }
.summary-tile .big.purple { color: #a855f7; }
.summary-tile .big.gold { color: #fbbf24; }

.goal-line { display:flex; align-items:center; justify-content:space-between; margin-top:14px; }
.goal-line .meta { color: var(--muted); font-size:13px; }
.progress-bar-bg { width: 100%; height: 10px; background: #1a1f2e; border-radius: 999px; overflow: hidden; border: 1px solid var(--border); margin-top:8px; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, #a855f7 0%, #00d4aa 100%); border-radius: 999px; transition: width 0.6s ease; }

.nav-menu {
  display: flex;
  gap: 4px;
  flex: 1;
  margin-left: 32px;
}

/* itens do menu */
.nav-item,
.dropdown-toggle {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* só hover visual, SEM movimentos */
.nav-item:hover,
.dropdown-toggle:hover {
  color: var(--text);
  background: rgba(0, 212, 170, 0.05);
}

.nav-item.active,
.dropdown-toggle.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* dropdown */
.nav-dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 180px;
  overflow: hidden;
  z-index: 300;
}

.nav-dropdown:hover .dropdown-menu {
  display: flex;
  flex-direction: column;
}

.dropdown-menu a {
  padding: 12px 20px;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.dropdown-menu a:last-child {
  border-bottom: none;
}

.dropdown-menu a:hover {
  background: rgba(0, 212, 170, 0.1);
  color: var(--accent);
}

/* ----------------------------------------------------------
   MAIN CONTENT
----------------------------------------------------------- */

main {
  flex: 1;
  padding: 24px;
  /* Keep content fully visible between the fixed header and footer */
  padding-top: calc(24px + var(--spa-header-offset, 0px));
  padding-bottom: calc(24px + var(--spa-footer-offset, 0px));
  margin-top: 0;
  margin-bottom: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  outline: none;
  opacity: 1;
}

.main-container {
  max-width: 1080px;
  width: 100%;
}

/* ----------------------------------------------------------
   DERO DASHBOARD (escopado)
   - Evita conflito com .card/.cards-grid da home
   - Reaplica o layout do legado (old_content/dero/index.html)
----------------------------------------------------------- */

.dero-dashboard header { margin-bottom: 12px; }
.dero-dashboard h1 { margin: 0 0 8px; font-weight: 700; letter-spacing: 0.2px; }
.dero-dashboard p { margin: 0 0 12px; color: var(--muted); }

.dero-dashboard .grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.dero-dashboard .card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(0,0,0,0.2) inset;
  text-align: center;
  display: block;
}

.dero-dashboard .card:hover { border-color: var(--border); }

.dero-dashboard .card strong {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.dero-dashboard .card div { font-size: 18px; font-weight: 600; }

.dero-dashboard .tabs {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  margin-bottom: 8px;
}

.dero-dashboard .tab {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}

.dero-dashboard .tab.active {
  background: linear-gradient(135deg, var(--dero-cyan) 0%, var(--accent-secondary) 100%);
  color: #fff;
  border-color: var(--dero-cyan);
  font-weight: 600;
}

.dero-dashboard .tablewrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 16px;
  background: var(--panel);
  overflow: auto;
}

.dero-dashboard table { width: 100%; border-collapse: collapse; }
.dero-dashboard th,
.dero-dashboard td { border-bottom: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.dero-dashboard th { position: sticky; top: 0; background: #0b1220; }

.dero-dashboard #chart {
  height: 220px;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  padding: 10px;
}

.dero-dashboard .pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.dero-dashboard .pagination button {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.dero-dashboard .pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.dero-dashboard .pagination button:not(:disabled):hover { background: #1e293b; }

.dero-dashboard #loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 48px;
  display: none;
  z-index: 1000;
}

.dero-dashboard #loading.show { display: block; }

.dero-dashboard .spinner {
  border: 3px solid var(--border);
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

@media (max-width: 820px) {
  .dero-dashboard .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .dero-dashboard .grid { grid-template-columns: 1fr; }
  .dero-dashboard .bar { flex-direction: column; align-items: stretch; }
}

/* legacy container helper (used by some pages) */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 24px;
  position: relative;
  z-index: 1;
}

/* Reduce the large gap under the global header for SPA pages (dashboard) */
#spa-main .container > header {
  margin-top: 8px;
  margin-bottom: 16px;
}

/* heading styles taken from legacy index for visual parity */
header { margin-bottom: 24px; margin-top: 24px; }
h1 { margin: 0 0 8px; font-weight: 700; letter-spacing: 0.2px; font-size: 32px; }
h2 { margin: 20px 0 12px; font-weight: 700; font-size: 24px; color: var(--accent); }

/* ----------------------------------------------------------
   Downloads / Tutoriais (portado do legacy)
----------------------------------------------------------- */

.guide-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.guide-section h2 { margin-top: 0; }

.code-block {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  /* Reserve space for the absolute "Copiar" button */
  padding-right: 84px;
  margin: 12px 0;
  position: relative;
  overflow-x: hidden;
}

.code-block pre { margin: 0; }

.code-block code,
.code-block pre {
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  color: #a5f3fc;
  /* Wrap long commands/URLs instead of forcing horizontal scroll */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.copy-code {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--border);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.copy-code:hover { color: var(--text); }

.info-box {
  background: rgba(0, 212, 170, 0.08);
  border: 1px solid rgba(0, 212, 170, 0.35);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 12px 0;
  font-size: 14px;
  color: var(--text);
}

/* DERO Minerar (layout legacy) */
.mining-guide { margin-top: 16px; }

.two-column-grid {
  display: grid;
  /* Use minmax(0, 1fr) so long <pre> lines don't force the column wider */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 1024px) {
  .two-column-grid { grid-template-columns: 1fr; }
}

.miner-card {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  /* Allow the card to shrink inside CSS grid when it contains long, unbroken text */
  min-width: 0;
}

.miner-card .code-block {
  max-width: 100%;
}

.miner-card h4 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.miner-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.miner-card a {
  color: var(--accent);
  text-decoration: none;
}

.miner-card a:hover { text-decoration: underline; }

.info-box.warning {
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid #fbbf24;
}

/* DERO Verificador (SPA) */
.wallet-checker { margin-top: 16px; }

.checker-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.checker-box h2 {
  margin: 0 0 8px;
  color: var(--text);
}

.checker-box p {
  color: var(--muted);
  margin-bottom: 20px;
}

.checker-input-wrapper {
  display: flex;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto 20px;
}

.checker-input-wrapper input {
  flex: 1;
  padding: 14px 16px;
  font-size: 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(11,18,32,0.9);
  color: var(--text);
  outline: none;
}

.checker-input-wrapper input::placeholder { color: #64748b; }

.btn-check {
  cursor: pointer;
  padding: 12px 18px;
  border-radius: 10px;
  border: none;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--dero-cyan) 0%, var(--dero-purple) 100%);
}

.btn-check:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.checker-result {
  padding: 20px;
  border-radius: 10px;
  margin-top: 16px;
  display: none;
}

.checker-result.valid {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
}

.checker-result.invalid {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
}

.checker-result .result-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.checker-result .result-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.checker-result .result-details {
  font-size: 14px;
  color: var(--muted);
  margin-top: 8px;
}

@media (max-width: 520px) {
  .checker-input-wrapper { flex-direction: column; }
}

.step-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.step-list li {
  padding: 8px 0 8px 28px;
  position: relative;
  margin-bottom: 8px;
  color: var(--text);
}

.step-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
}

.options-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.options-list li { margin-bottom: 12px; }
.muted { color: var(--muted); }

.download-link { font-weight: 700; }
h3 { margin: 16px 0 12px; font-weight: 600; font-size: 18px; }
p { margin: 0 0 12px; color: var(--muted); line-height: 1.6; }

/* ----------------------------------------------------------
   CARDS
----------------------------------------------------------- */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
  margin-bottom: 32px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.card:hover {
  border-color: var(--accent);
}

.card-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.card h3 {
  margin: 12px 0 8px;
}

.card p {
  flex: 1;
  margin-bottom: 16px;
}

.card-btn {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-secondary) 100%);
  color: white;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
}

/* ----------------------------------------------------------
   SECTIONS
----------------------------------------------------------- */

.section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-top: 24px;
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.link-section {
  background: #0b1220;
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 10px;
}

.link-section h4 {
  margin: 0 0 12px;
  color: var(--accent);
}

.link-section ul {
  margin: 0;
  padding-left: 18px;
}

.link-section li {
  margin: 8px 0;
}

.link-section a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----------------------------------------------------------
   FOOTER
----------------------------------------------------------- */

footer {
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  margin-top: auto;
}

/* Compact SPA footer styling (matches header color and thin height) */
#spa-footer {
  background: var(--panel);
  border-top: 1px solid var(--border);
  color: var(--muted);
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 190;
  /* Add breathing room inside the bar (children have inline padding) */
  padding: 10px 0 16px;
}

#spa-footer > div { padding: 0; }
#spa-footer a {
  background: rgba(0,212,170,0.06) !important;
  padding: 6px 10px !important;
  border-radius: 12px !important;
  font-size: 13px !important;
}

#spa-footer span { font-size: 12px; }

/* ----------------------------------------------------------
   RESPONSIVIDADE
----------------------------------------------------------- */

@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .links-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  main {
    padding: 12px;
    padding-top: calc(12px + var(--spa-header-offset, 0px));
    padding-bottom: calc(12px + var(--spa-footer-offset, 0px));
    margin-top: 0;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .links-grid {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------------
   YouTube subscribers badge — dramatic hover & touch CTA
   - On hover / active: hide the numeric count and show "INSCREVA-SE"
   - More pronounced scale, stronger shadow and gradient background
   - Supports keyboard focus and touch (class `yt-active`)
----------------------------------------------------------- */
.yt-badge {
  --base-bg: #222;
  --hover-grad: linear-gradient(90deg, #ff4b4b 0%, #b31217 100%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start; /* left-align icon + count */
  background: var(--base-bg);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  border-radius: 10px;
  padding: 8px 14px;
  text-decoration: none;
  transition: transform 220ms cubic-bezier(.2,.9,.3,1), box-shadow 220ms ease, background 220ms ease, color 220ms ease;
  will-change: transform, box-shadow, background;
  position: relative;
  overflow: hidden; /* ensure children can't render outside the rounded box */
}

/* Prevent the badge from stretching to full width inside header flex containers */
.nav-logo-right {
  display: flex;
  align-items: center;
}

.nav-logo-right .yt-badge {
  flex: 0 0 auto;
  width: auto;
  max-width: 320px; /* avoid overly wide button */
  justify-content: center; /* center items horizontally */
}

/* Ensure the container itself doesn't stretch inside the nav flex row */
.nav-container > .nav-logo-right {
  flex: 0 0 auto;
}

/* Make the badge size strictly fit its content */
.yt-badge {
  display: inline-flex !important;
  width: auto !important;
  min-width: 0 !important;
  padding: 8px 16px !important;
  box-sizing: border-box;
}

/* If some rule forces anchors to be full width, override it here */
.main-nav a.yt-badge {
  display: inline-flex !important;
  width: auto !important;
}

/* High-specificity overrides to prevent unexpected width expansion */
.main-nav .nav-container > .nav-logo-right {
  flex: 0 0 auto !important;
  margin-left: auto !important;
  align-items: center !important;
}

.main-nav .nav-container > .nav-logo-right .yt-badge {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: 220px !important;
  padding: 6px 12px !important;
  justify-content: center !important;
}

/* If any global rule makes anchors stretch, ensure the badge avoids it */
nav.main-nav a.yt-badge {
  display: inline-flex !important;
  width: auto !important;
}

.yt-badge .yt-count { white-space: nowrap; }
.yt-badge .yt-cta { white-space: nowrap; margin-left: 8px; }

.yt-badge .yt-icon {
  height: 22px;
  width: 22px;
  flex: 0 0 auto;
  display: block;
  margin-left: 2px;
  margin-right: 8px;
}

.yt-badge .yt-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-weight: 700;
  transition: opacity 180ms ease, transform 220ms cubic-bezier(.2,.9,.3,1);
  transform-origin: center;
}

.yt-badge .yt-count .yt-label {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

.yt-badge .yt-cta {
  position: absolute; /* center the CTA inside the badge */
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.98);
  display: inline-block;
  opacity: 0;
  transition: opacity 180ms ease, transform 220ms cubic-bezier(.2,.9,.3,1);
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-size: 13px;
  color: white;
  pointer-events: none; /* clicks should hit the anchor */
  padding: 0 10px;
  white-space: nowrap;
}

.yt-badge:hover,
.yt-badge.yt-active,
.yt-badge:focus {
  transform: translateY(-4px) scale(1.12);
  box-shadow: 0 18px 40px rgba(179,18,23,0.30), 0 6px 18px rgba(0,0,0,0.45);
  background: var(--hover-grad);
  color: #fff;
}

.yt-badge:hover .yt-count,
.yt-badge.yt-active .yt-count,
.yt-badge:focus .yt-count {
  opacity: 0;
  transform: translateX(-18px) scale(0.92);
}

.yt-badge:hover .yt-cta,
.yt-badge.yt-active .yt-cta,
.yt-badge:focus .yt-cta {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Mobile tweaks */
@media (max-width: 420px) {
  .yt-badge { font-size: 14px; padding: 6px 10px; }
  .yt-badge .yt-cta { font-size: 13px; }
}

/* ----------------------------------------------------------
   Modal para imagens (copiado do layout legacy)
----------------------------------------------------------- */
.image-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  animation: fadeIn 0.2s;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.image-modal.show { display: flex; }
.modal-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 90%;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  animation: slideUp 0.3s;
}
.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 24px;
  padding: 5px 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--accent); color: #000; border-color: var(--accent); }
.modal-image { max-width: 100%; display: block; border-radius: 8px; margin: 10px; }
.thumbnail-preview { cursor: pointer; max-width: 280px; border: 2px solid var(--border); border-radius: 8px; transition: all 0.2s; margin-top: 12px; }
.thumbnail-preview:hover { border-color: var(--accent); box-shadow: 0 0 12px rgba(0, 212, 170, 0.3); transform: scale(1.02); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
