/* Changelog de Slap Battles: botón en el changelog de la web y ventana de dos paneles
   (archivo: css/components/sb-changelog.css) */

/* ── Botón dentro del changelog de la web ── */
#btn-open-sbcl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 13px;
  font-family: 'Fredoka One', cursive;
  font-size: .82rem;
  letter-spacing: .3px;
  color: #1a1400;
  background: linear-gradient(180deg, var(--yellow-bright, #FFD700), var(--yellow-dark, #C89A00));
  border: 3px solid #000;
  border-radius: 999px;
  box-shadow: 0 4px 0 #000;
  cursor: pointer;
  transition: filter .15s;
}
#btn-open-sbcl:hover { filter: brightness(1.08); }
#btn-open-sbcl:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
#btn-open-sbcl:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ── Ventana ── */
#sbcl-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;          /* por encima de los botones flotantes (buzón, cuenta…) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(4,4,6,.86);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
#sbcl-overlay.open { opacity: 1; pointer-events: all; }

#sbcl-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(96vw, 1180px);
  height: min(90vh, 860px);
  overflow: hidden;
  background: #12161f;
  border: 5px solid #000;
  border-radius: 22px;
  box-shadow: 8px 9px 0 #000, 0 26px 70px rgba(0,0,0,.85);
  transform: translateY(16px) scale(.97);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
#sbcl-overlay.open #sbcl-modal { transform: none; }
#sbcl-modal::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 9px;
  z-index: 2;
  background: repeating-linear-gradient(45deg, var(--yellow-stripe1, #F0B800) 0 12px, #111 12px 24px);
}

/* Cabecera */
#sbcl-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 19px 16px 12px;
  border-bottom: 4px solid #000;
  background: linear-gradient(180deg, #1e2430 0%, #131821 100%);
  flex-shrink: 0;
}
#sbcl-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: 'Fredoka One', cursive;
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 1.5px;
  color: var(--yellow-bright, #FFD700);
  text-shadow: 2px 2px 0 #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#sbcl-back, #sbcl-close, #sbcl-nav button {
  flex-shrink: 0;
  height: 38px;
  padding: 0 12px;
  font-family: 'Fredoka One', cursive;
  font-size: .9rem;
  color: #fff;
  background: linear-gradient(180deg, #3a3a42, #202026);
  border: 4px solid #000;
  border-radius: 12px;
  box-shadow: 0 4px 0 #000;
  cursor: pointer;
}
#sbcl-close { width: 38px; padding: 0; }
#sbcl-back:active, #sbcl-close:active, #sbcl-nav button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
#sbcl-nav button:disabled { opacity: .35; cursor: default; }
#sbcl-main:focus { outline: none; }
#sbcl-modal button:focus-visible, #sbcl-modal select:focus-visible, #sbcl-modal a:focus-visible {
  outline: 3px solid #fff; outline-offset: 2px;
}

/* Dos paneles */
#sbcl-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
}

/* ── Panel izquierdo: selector de actualizaciones ── */
#sbcl-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 4px solid #000;
  background: #0b0e14;
}
#sbcl-nav {
  display: flex;
  gap: 6px;
  padding: 14px 14px 12px;
  border-bottom: 3px solid #000;
  background: #0b0e14;
  flex-shrink: 0;
}
#sbcl-nav button { width: 38px; padding: 0; }
#sbcl-select {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 8px;
  font-family: 'Fredoka', sans-serif;
  font-size: .82rem;
  color: #fff;
  background: #1b2029;
  border: 3px solid #000;
  border-radius: 10px;
}

#sbcl-list {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0 12px 14px;
  list-style: none;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #3a4152 transparent;
}
.sbcl-year {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0 -12px;
  padding: 8px 14px 6px;
  font-family: 'Fredoka One', cursive;
  font-size: .85rem;
  letter-spacing: 1px;
  color: var(--yellow-bright, #FFD700);
  text-shadow: 2px 2px 0 #000;
  background: #0b0e14;
  box-shadow: 0 6px 8px -4px #0b0e14;
}
.sbcl-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  font-family: 'Fredoka', sans-serif;
  text-align: left;
  color: #c9ced8;
  background: none;
  border: 0;
  cursor: pointer;
}
.sbcl-card-meta { padding: 0 4px; font-size: .78rem; }
.sbcl-card-meta b { color: #f2f2f2; font-weight: 600; }

.sbcl-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #2b3241, #12161f 75%);
  border: 4px solid #000;
  border-radius: 14px;
  box-shadow: 0 4px 0 #000;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.sbcl-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sbcl-thumb.empty::before, .sbcl-thumb.broken::before { content: '📰'; font-size: 2rem; line-height: 1; }
.sbcl-thumb-tag {
  position: absolute;
  top: 6px; left: 6px;
  padding: 2px 8px;
  font-family: 'Fredoka One', cursive;
  font-size: .62rem;
  letter-spacing: .4px;
  color: #1a1400;
  background: var(--yellow-bright, #FFD700);
  border: 2px solid #000;
  border-radius: 999px;
}
.sbcl-thumb.has-mastery .sbcl-thumb-tag { background: #c4b5fd; }
.sbcl-thumb.empty .sbcl-thumb-tag { background: #3a4152; color: #e5e7eb; }
/* Pie de la foto: nombre a la izquierda, iconos de lo demás a la derecha */
.sbcl-thumb-foot {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 16px 6px 5px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
}
.sbcl-thumb-name {
  flex: 1;
  min-width: 0;
  font-family: 'Fredoka One', cursive;
  font-size: .82rem;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sbcl-thumb-name:empty { display: none; }
/* El primer icono queda a la derecha del todo; los siguientes, a su izquierda */
.sbcl-icons { display: flex; flex-direction: row-reverse; gap: 3px; flex-shrink: 0; margin-left: auto; }
.sbcl-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  overflow: hidden;
  font-family: 'Fredoka One', cursive;
  font-size: .62rem;
  color: #fff;
  background: #1b2029;
  border: 2px solid #000;
  border-radius: 8px;
  box-shadow: 0 2px 0 #000;
}
.sbcl-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sbcl-icon.mastery { border-color: #c4b5fd; background: #241c3a; }
.sbcl-icon.mastery img { object-fit: contain; padding: 1px; }
.sbcl-icon.more { background: #3a4152; }
.sbcl-type {
  align-self: flex-end;
  padding: 3px 10px;
  font-family: 'Fredoka One', cursive;
  font-size: .78rem;
  color: #1a1400;
  background: var(--yellow-bright, #FFD700);
  border: 2px solid #000;
  border-radius: 999px;
}
.sbcl-card:hover .sbcl-thumb { transform: translateY(-2px); box-shadow: 0 6px 0 #000; }
.sbcl-card:active .sbcl-thumb { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.sbcl-card.selected .sbcl-thumb {
  border-color: var(--yellow-bright, #FFD700);
  box-shadow: 0 4px 0 #000, 0 0 0 3px #000, 0 0 18px rgba(255,215,0,.35);
}
.sbcl-card.selected .sbcl-card-meta,
.sbcl-card.selected .sbcl-card-meta b { color: var(--yellow-bright, #FFD700); }
.sbcl-card:focus-visible { outline: none; }
.sbcl-card:focus-visible .sbcl-thumb { outline: 3px solid #fff; outline-offset: 2px; }

#sbcl-source {
  margin: 0;
  padding: 9px 14px 11px;
  font-size: .7rem;
  line-height: 1.45;
  color: #6f7686;
  border-top: 3px solid #000;
  flex-shrink: 0;
}
#sbcl-source a { color: #9aa3b5; }

/* ── Panel derecho ── */
#sbcl-main {
  overflow-y: auto;
  padding: 16px 20px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: #3a4152 transparent;
}
#sbcl-info {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 18px;
  padding-bottom: 12px;
  border-bottom: 3px dashed #262c38;
}
#sbcl-version-box { display: flex; flex-direction: column; gap: 1px; }
#sbcl-version {
  font-family: 'Fredoka One', cursive;
  font-size: 1.45rem;
  color: var(--yellow-bright, #FFD700);
  text-shadow: 2px 2px 0 #000;
  letter-spacing: .5px;
}
#sbcl-date { font-size: .92rem; color: #d7dbe3; }
#sbcl-added { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; }
.sbcl-added-title { font-size: .74rem; color: #8b93a3; margin-right: 2px; }
.sbcl-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  font-size: .78rem;
  color: #f2f2f2;
  text-decoration: none;
  background: #1b2029;
  border: 2px solid #000;
  border-radius: 999px;
}
a.sbcl-chip:hover { border-color: var(--yellow-bright, #FFD700); }
.sbcl-chip.mastery { background: #241c3a; }

.sbcl-cat {
  --sbcl-accent: #FFD700;
  background: #0f131b;
  border: 3px solid #000;
  border-left: 7px solid var(--sbcl-accent);
  border-radius: 14px;
  padding: 12px 14px 12px 12px;
}
.sbcl-added   { --sbcl-accent: #39d353; }
.sbcl-changes { --sbcl-accent: #FFD700; }
.sbcl-fixes   { --sbcl-accent: #38bdf8; }
.sbcl-removed { --sbcl-accent: #f87171; }
.sbcl-royale  { --sbcl-accent: #9ca3af; }
.sbcl-other   { --sbcl-accent: #c4b5fd; }
.sbcl-cat h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-family: 'Fredoka One', cursive;
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: .5px;
  color: #f2f2f2;
}
.sbcl-cat-icon { font-size: 1.05rem; }
.sbcl-count {
  margin-left: auto;
  min-width: 26px;
  padding: 1px 8px;
  font-family: 'Fredoka', sans-serif;
  font-size: .74rem;
  text-align: center;
  color: #c9ced8;
  background: #1b2029;
  border-radius: 999px;
}
.sbcl-cat ul { margin: 0; padding-left: 18px; list-style: none; }
.sbcl-cat > ul { padding-left: 4px; }
.sbcl-cat li {
  position: relative;
  padding: 3px 0 3px 14px;
  font-size: .9rem;
  line-height: 1.5;
  color: #d7dbe3;
}
.sbcl-cat li::before {
  content: '';
  position: absolute;
  left: 0; top: .78em;
  width: 6px; height: 6px;
  border-radius: 2px;
  background: var(--sbcl-accent);
}
.sbcl-cat ul ul li { font-size: .86rem; color: #b7bdca; }
.sbcl-cat ul ul li::before { background: #4b5263; border-radius: 50%; }
.sbcl-cat li.sbcl-sub {
  margin-top: 6px;
  padding-left: 0;
  font-family: 'Fredoka One', cursive;
  font-size: .9rem;
  color: #fff;
}
.sbcl-cat li.sbcl-sub::before, .sbcl-cat li.sbcl-nest::before { display: none; }
.sbcl-cat li.sbcl-nest { padding-left: 0; }
.sbcl-cat li b { color: #fff; }

.sbcl-link {
  color: #ffe169;
  text-decoration: none;
  border-bottom: 2px solid rgba(255,215,0,.35);
}
.sbcl-link:hover { border-bottom-color: #ffe169; }
.sbcl-link.mastery { color: #d4c8ff; border-bottom-color: rgba(196,181,253,.4); }
.sbcl-term { color: #f2f2f2; }
.sbcl-arrow { font-weight: 700; padding: 0 2px; }
.sbcl-arrow.nerf { color: #f87171; }
.sbcl-arrow.buff { color: #4ade80; }
.sbcl-empty { color: #8b93a3; font-size: .9rem; padding: 20px 4px; }

/* ── Móvil: selector arriba (tira horizontal de tarjetas) y cambios debajo ── */
@media (max-width: 760px) {
  #sbcl-overlay { padding: 0; }
  #sbcl-modal { width: 100vw; height: 100dvh; border-radius: 0; border-width: 0; box-shadow: none; }
  #sbcl-title { font-size: .95rem; letter-spacing: .5px; }
  #sbcl-body { display: block; overflow-y: auto; }
  #sbcl-side { border-right: 0; border-bottom: 4px solid #000; }
  #sbcl-nav { padding: 12px; }
  #sbcl-list {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
  }
  #sbcl-list > li { flex: 0 0 auto; }
  .sbcl-year {
    position: static;
    align-self: center;
    margin: 0;
    padding: 0 2px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    background: none;
  }
  .sbcl-card { width: 150px; margin: 0; scroll-snap-align: center; }
  .sbcl-thumb-name { font-size: .72rem; }
  #sbcl-source { display: none; }
  #sbcl-main { overflow: visible; padding: 14px 12px 30px; }
  #sbcl-version { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  #sbcl-modal { transition: none; transform: none; }
  .sbcl-thumb { transition: none; }
}
