/* =====================
   cassino.css
===================== */

.cas-body {
  background: var(--bg-primary);
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-nav-h) + 16px);
  overflow-x: hidden;
}

/* =====================
   CATEGORIAS
===================== */
.cas-categories {
  padding: 12px 16px 0;
  overflow: hidden;
}

.cas-categories__track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.cas-categories__track::-webkit-scrollbar { display: none; }

.cas-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font);
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 64px;
}

.cas-cat i { font-size: 1.3rem; }

.cas-cat.active {
  border-color: var(--accent-green);
  color: var(--accent-green);
  background: rgba(81,230,132,0.08);
}

.cas-cat:hover:not(.active) {
  border-color: var(--border-color);
  color: var(--text-primary);
}

/* =====================
   CONTROLES
===================== */
.cas-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 10px;
}

.cas-controls__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cas-controls__btns {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cas-ctrl-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.2s;
}

.cas-ctrl-btn:hover { border-color: var(--accent-green); }

.cas-filter-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-green);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
}

.cas-filter-badge.hidden { display: none; }

/* =====================
   SORT DROPDOWN
===================== */
.cas-sort-wrap { position: relative; }

.cas-sort-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  min-width: 160px;
  z-index: 200;
  overflow: hidden;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.cas-sort-dropdown.open { display: block; }

.cas-sort-item {
  width: 100%;
  padding: 13px 16px;
  text-align: left;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 500;
  font-family: var(--font);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border-color);
}

.cas-sort-item:last-child { border-bottom: none; }
.cas-sort-item:hover { background: var(--bg-card-hover); }
.cas-sort-item.active { color: var(--accent-green); font-weight: 700; }

.cas-sort-check { font-size: 0.9rem; }

/* =====================
   GRID DE JOGOS
===================== */
.cas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px 16px;
}

.cas-game-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  aspect-ratio: 3/2.2;
  transition: transform 0.18s;
}

/* Imagem do jogo — cobre todo o card */
.cas-game-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}

.cas-game-card:active { transform: scale(0.97); }

.cas-game-card__bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-md);
}

/* Fallback gradiente quando não há imagem */
.cas-game-card__bg--fallback {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-end;
  padding: 10px;
}

.cas-game-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 35%, rgba(0,0,0,0.82) 100%);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px;
}

.cas-game-card__badges {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}

.cas-badge {
  font-size: 0.58rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.cas-badge--novo     { background: var(--accent-green); color: #000; }
.cas-badge--popular  { background: rgba(255,255,255,0.18); color: #fff; border: 1px solid rgba(255,255,255,0.3); }



.cas-game-card__name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cas-game-card__provider {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: block;
  margin-top: 1px;
}

/* =====================
   OVERLAY GERAL
===================== */
.cas-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 300;
  backdrop-filter: blur(2px);
}

.cas-overlay.active { display: block; }

/* =====================
   BOTTOM SHEET BASE
===================== */
.cas-filter-sheet,
.cas-game-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: #010830;
  border-radius: 20px 20px 0 0;
  z-index: 400;
  transform: translateY(100%);
  transition: transform 0.33s cubic-bezier(0.4,0,0.2,1);
}

.cas-filter-sheet.open,
.cas-game-sheet.open {
  transform: translateY(0);
}

.cas-sheet__handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-color);
  margin: 12px auto 0;
}

/* =====================
   FILTROS SHEET
===================== */
.cas-filter-sheet {
  max-height: 88vh;
  overflow-y: auto;
  scrollbar-width: none;
  padding-bottom: 24px;
}

.cas-filter-sheet::-webkit-scrollbar { display: none; }

.cas-sheet__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  padding: 16px 16px 8px;
  border-bottom: 1px solid var(--border-color);
}

.cas-filter-group {
  border-bottom: 1px solid var(--border-color);
}

.cas-filter-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
}

.cas-filter-head__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cas-filter-count {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-green);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
}

.cas-filter-count.hidden { display: none; }

.cas-filter-caret {
  color: var(--text-secondary);
  font-size: 1rem;
  transition: transform 0.25s;
}

.cas-filter-caret.open { transform: rotate(180deg); }

.cas-filter-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
}

.cas-filter-body.open { max-height: 300px; }

.cas-filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 20px 16px;
}

.cas-ftag {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-color);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
}

.cas-ftag:hover { border-color: var(--accent-green); color: var(--accent-green); }

.cas-ftag.active {
  border-color: var(--accent-green);
  color: var(--accent-green);
  background: rgba(81,230,132,0.1);
}

/* AÇÕES FILTRO */
.cas-filter-actions {
  display: flex;
  gap: 12px;
  padding: 16px 20px 8px;
}

.cas-filter-clear {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: border-color 0.2s;
}

.cas-filter-clear:hover { border-color: var(--text-primary); }

.cas-filter-confirm {
  flex: 2;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: #fff;
  color: #000;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 0.2s;
}

.cas-filter-confirm:hover { opacity: 0.88; }

/* =====================
   JANELA DO JOGO
===================== */
.cas-game-sheet {
  padding-bottom: 28px;
}

.cas-game-sheet__img {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #001a4d, #003994);
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  position: relative;
}

.cas-game-sheet__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cas-game-sheet__info {
  padding: 16px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cas-game-sheet__badges {
  display: flex;
  gap: 6px;
}

.cas-game-sheet__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cas-game-sheet__name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.cas-game-sheet__provider {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

.cas-game-sheet__actions {
  display: flex;
  gap: 8px;
}

.cas-game-sheet__icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.cas-game-sheet__icon-btn:hover { border-color: var(--accent-green); color: var(--accent-green); }
.cas-game-sheet__icon-btn.favorited { color: #ffd54f; border-color: #ffd54f; }

.cas-game-sheet__tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cas-game-tag {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--accent-green);
  background: rgba(81,230,132,0.08);
  color: var(--accent-green);
  font-size: 0.78rem;
  font-weight: 600;
}

.cas-game-sheet__play {
  width: 100%;
  padding: 15px;
  border-radius: var(--radius-sm);
  background: #fff;
  color: #000;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: opacity 0.2s;
  margin-top: 4px;
}

.cas-game-sheet__play:hover { opacity: 0.88; }