/* Montador de combo: escolha 5 jogos, os 2 mais baratos saem grátis. */
.cb {
  --cb-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --cb-gold: #f2c14e;
  --cb-red: #ff5a5f;
  max-width: 1280px;
  padding-top: 36px;
  padding-bottom: 80px;
}

/* ---------- Cabeçalho ---------- */
.cb-head { margin-bottom: 30px; }

.cb-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cb-gold);
  font: 700 11px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cb-title {
  margin-top: 12px;
  font: 800 clamp(1.9rem, 4vw, 3rem) / 1.04 'Plus Jakarta Sans', Manrope, sans-serif;
  letter-spacing: -0.04em;
  color: #fff;
}
.cb-title em { font-style: normal; color: var(--cb-gold); }

.cb-sub { margin-top: 10px; color: rgb(255 255 255 / 0.7); font-size: 1rem; }

.cb-steps { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.cb-steps li {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px 8px 8px;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.04);
  color: rgb(255 255 255 / 0.8);
  font-size: 0.82rem;
  font-weight: 700;
}
.cb-steps b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: hsl(var(--primary));
  color: #160a38;
  font-size: 0.78rem;
}

/* ---------- Layout ---------- */
.cb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; align-items: start; gap: 28px; }

/* ---------- Busca ---------- */
.cb-tools { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 12px; }
.cb-search, .cb-select { position: relative; }
.cb-search__icon { position: absolute; left: 16px; top: 50%; width: 17px; height: 17px; color: rgb(var(--fg2)); transform: translateY(-50%); pointer-events: none; }
.cb-select__chev { position: absolute; right: 14px; top: 50%; width: 16px; height: 16px; color: rgb(var(--fg2)); transform: translateY(-50%); pointer-events: none; }

.cb-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 14px;
  background: rgb(255 255 255 / 0.04);
  color: #fff;
  font-size: 0.9rem;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.3s ease;
}
.cb-search .cb-input { padding-left: 44px; }
.cb-select .cb-input { padding-right: 38px; cursor: pointer; }
.cb-input::placeholder { color: rgb(var(--fg2)); }
.cb-input:hover { border-color: rgb(255 255 255 / 0.26); }
.cb-input:focus { outline: none; border-color: hsl(var(--primary) / 0.6); box-shadow: 0 0 0 4px hsl(var(--primary) / 0.14); }
.cb-input option { background: #120a26; color: #fff; }

.cb-count { margin: 16px 0 14px; color: rgb(var(--fg2)); font-size: 0.82rem; font-weight: 600; }
.cb-empty { padding: 40px 16px; text-align: center; color: rgb(var(--fg2)); }

/* ---------- Grade de jogos ---------- */
.cb-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

.cb-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgb(137 90 246 / 0.22);
  border-radius: 16px;
  background: linear-gradient(180deg, #191030, #0f0a20);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.35s var(--cb-ease), border-color 0.25s ease, box-shadow 0.35s ease, opacity 0.25s ease;
}

.cb-card__cover { position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden; background: #0a0614; }
.cb-card__cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--cb-ease); }

.cb-card__check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid rgb(255 255 255 / 0.55);
  border-radius: 50%;
  background: rgb(10 6 20 / 0.55);
  color: transparent;
  transition: transform 0.35s var(--cb-ease), background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.cb-card__check svg { width: 16px; height: 16px; }

.cb-card__body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.cb-card__name { overflow: hidden; color: #fff; font-size: 0.9rem; font-weight: 800; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.cb-card__price { color: #d9ccff; font: 800 1rem/1 'Plus Jakarta Sans', Manrope, sans-serif; letter-spacing: -0.02em; }

@media (hover: hover) and (pointer: fine) {
  .cb-card:hover { transform: translateY(-5px); border-color: rgb(137 90 246 / 0.6); box-shadow: 0 22px 44px -26px rgb(137 90 246 / 0.55); }
  .cb-card:hover .cb-card__cover img { transform: scale(1.06); }
}
.cb-card:focus-visible { outline: 2px solid hsl(var(--primary)); outline-offset: 3px; }

.cb-card.is-on { border-color: var(--cb-gold); box-shadow: 0 0 0 1px rgb(242 193 78 / 0.4), 0 22px 44px -26px rgb(242 193 78 / 0.55); }
.cb-card.is-on .cb-card__check { transform: scale(1.12); border-color: var(--cb-gold); background: var(--cb-gold); color: #3a2503; }
.cb-card.is-locked { opacity: 0.4; }

/* ---------- Painel ---------- */
.cb-panel {
  position: sticky;
  top: calc(92px + var(--promo-h, 0px));
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgb(242 193 78 / 0.28);
  border-radius: 22px;
  background:
    radial-gradient(100% 70% at 100% 0%, rgb(242 193 78 / 0.12), transparent 55%),
    linear-gradient(180deg, #1b1131 0%, #0f0a20 100%);
  box-shadow: 0 28px 60px -34px rgb(242 193 78 / 0.5);
  transition: border-color 0.3s ease, box-shadow 0.4s ease;
}
.cb-panel.is-ready { border-color: rgb(242 193 78 / 0.7); box-shadow: 0 0 0 1px rgb(242 193 78 / 0.2), 0 30px 70px -30px rgb(242 193 78 / 0.7); }
.cb-panel.is-shake { animation: cb-shake 0.45s ease; }

.cb-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cb-panel__title { font: 800 1.3rem/1 'Plus Jakarta Sans', Manrope, sans-serif; letter-spacing: -0.03em; color: #fff; }
.cb-progress {
  padding: 6px 12px;
  border-radius: 999px;
  background: hsl(var(--primary) / 0.2);
  color: #e6dcff;
  font: 800 0.82rem/1 'JetBrains Mono', monospace;
}
.cb-panel.is-ready .cb-progress { background: var(--cb-gold); color: #3a2503; }

.cb-slots { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }

.cb-slot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 8px 10px;
  border: 1px dashed rgb(255 255 255 / 0.18);
  border-radius: 14px;
  color: rgb(var(--fg3));
  font-size: 0.84rem;
  font-weight: 600;
}
.cb-slot__num {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.06);
  font-weight: 800;
}

.cb-slot.is-filled { border-style: solid; border-color: rgb(255 255 255 / 0.12); background: rgb(255 255 255 / 0.04); color: #fff; animation: cb-pop 0.4s var(--cb-ease); }
.cb-slot.is-free { border-color: rgb(255 90 95 / 0.55); background: rgb(255 90 95 / 0.1); }

.cb-slot__thumb { flex: none; width: 36px; height: 48px; overflow: hidden; border-radius: 7px; background: #0a0614; }
.cb-slot__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cb-slot__info { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.cb-slot__name { overflow: hidden; font-size: 0.86rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.cb-slot__price { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700; color: #d9ccff; }
.cb-slot__price s { color: rgb(255 255 255 / 0.4); }
.cb-slot__free { padding: 3px 8px; border-radius: 6px; background: var(--cb-red); color: #fff; font-size: 0.68rem; letter-spacing: 0.06em; }

.cb-slot__remove {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 9px;
  background: rgb(255 255 255 / 0.04);
  color: rgb(255 255 255 / 0.7);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.cb-slot__remove:hover { background: rgb(255 90 95 / 0.2); color: #fff; }
.cb-slot__remove:focus-visible { outline: 2px solid hsl(var(--primary)); outline-offset: 2px; }
.cb-slot__remove svg { width: 14px; height: 14px; }

/* ---------- Totais ---------- */
.cb-sum { display: grid; gap: 8px; margin: 0; padding-top: 14px; border-top: 1px solid rgb(255 255 255 / 0.08); }
.cb-sum__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cb-sum dt { color: rgb(255 255 255 / 0.7); font-size: 0.86rem; font-weight: 600; }
.cb-sum dd { margin: 0; color: #fff; font-size: 0.95rem; font-weight: 800; }
.cb-sum__row--save dd { color: #6ee7b7; }
.cb-sum__row[hidden] { display: none; }
.cb-sum__row--total { padding-top: 10px; border-top: 1px solid rgb(255 255 255 / 0.08); }
.cb-sum__row--total dt { color: #fff; font-weight: 800; }
.cb-sum__row--total dd { color: var(--cb-gold); font: 800 1.75rem/1 'Plus Jakarta Sans', Manrope, sans-serif; letter-spacing: -0.04em; }

.cb-hint { margin: 0; color: rgb(255 255 255 / 0.75); font-size: 0.84rem; font-weight: 600; line-height: 1.4; }

.cb-add {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 54px;
  overflow: hidden;
  border: 1px solid #2a1569;
  border-radius: 14px;
  background: radial-gradient(110% 130% at 47% 0, #b79bff 38%, #9a6bff 69%, #6a3fe0);
  color: #160a38;
  font: 800 0.95rem/1 Manrope, sans-serif;
  cursor: pointer;
  box-shadow: 0 16px 30px -14px rgb(0 0 0 / 0.6);
  transition: filter 0.2s ease, transform 0.25s var(--cb-ease), opacity 0.2s ease;
}
.cb-add:not(:disabled):hover { filter: brightness(1.08); transform: translateY(-2px); }
.cb-add:focus-visible { outline: 2px solid #b79bff; outline-offset: 3px; }
.cb-add:disabled { opacity: 0.45; cursor: not-allowed; }
.cb-add.is-loading { opacity: 0.7; pointer-events: none; }
.cb-panel.is-ready .cb-add::after {
  content: '';
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: 0;
  width: 28%;
  background: linear-gradient(100deg, transparent, rgb(236 228 255 / 0.55), transparent);
  transform: translateX(-160%) skewX(-18deg);
  animation: cb-shine 3.8s cubic-bezier(0.45, 0, 0.2, 1) 0.6s infinite;
  pointer-events: none;
}

.cb-note { margin: 0; color: rgb(var(--fg3)); font-size: 0.74rem; line-height: 1.45; text-align: center; }

@keyframes cb-pop { from { opacity: 0; transform: scale(0.94); } }
@keyframes cb-shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes cb-shine { 0% { transform: translateX(-160%) skewX(-18deg); } 30%, 100% { transform: translateX(460%) skewX(-18deg); } }

/* ---------- Responsivo ---------- */
@media (max-width: 1199px) {
  .cb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cb-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; }
}

@media (max-width: 999px) {
  .cb-layout { grid-template-columns: 1fr; }
  .cb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* painel vira barra fixa na base; os espaços ficam em miniatura */
  .cb-panel {
    position: fixed;
    left: 0;
    right: 0;
    top: auto;
    height: auto;
    max-height: none;
    bottom: var(--cb-tabbar, 0px);
    z-index: 44;
    gap: 10px;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    border-width: 1px 0 0;
    backdrop-filter: blur(14px);
  }
  .cb-panel__title, .cb-note, .cb-sum__row:not(.cb-sum__row--total) { display: none; }
  .cb-panel__head { order: 1; }
  .cb-slots { order: 0; grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .cb-slot { justify-content: center; min-height: 0; padding: 4px; }
  .cb-slot__info, .cb-slot__empty, .cb-slot__remove { display: none; }
  .cb-slot__thumb { width: 100%; height: auto; aspect-ratio: 2 / 3; }
  .cb-slot.is-free::after { content: 'GRÁTIS'; position: absolute; bottom: 4px; left: 4px; right: 4px; padding: 2px 0; border-radius: 5px; background: var(--cb-red); color: #fff; font-size: 0.5rem; font-weight: 800; text-align: center; }
  .cb-sum { order: 2; padding-top: 8px; }
  .cb-sum__row--total { padding-top: 0; border-top: 0; }
  .cb-sum__row--total dd { font-size: 1.3rem; }
  .cb-hint { order: 3; font-size: 0.78rem; }
  .cb-add { order: 4; min-height: 50px; }
  .cb { padding-bottom: 300px; }
}

@media (max-width: 639px) {
  .cb { padding-top: 22px; }
  .cb-tools { grid-template-columns: 1fr; }
  .cb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cb-steps li { font-size: 0.76rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cb-slot.is-filled, .cb-panel.is-shake, .cb-panel.is-ready .cb-add::after { animation: none; }
  .cb-card, .cb-card__cover img { transition: none; }
}

/* No celular a barra de abas do site ocupa a base: o painel fixo fica logo acima dela. */
@media (max-width: 999px) {
  .cb { --cb-tabbar: calc(78px + env(safe-area-inset-bottom, 0px)); }
  .cb-panel { padding-bottom: 12px; }
  .cb { padding-bottom: 380px; }
}
