/* ── GAME GRID ── */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

/* ── GAME STACK ── */
.game-stack-wrapper {
  position: relative;
  transition: transform 0.2s;
}
.game-stack-wrapper:hover {
  z-index: 10;
}
.game-stack-layer {
  position: absolute;
  top: auto; right: auto;
  bottom: 0; left: 0;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  background: #111118;
  border: 1px solid var(--border);
  border-radius: var(--r2);
  z-index: 0;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}
.stack-layer-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1;
}
.game-stack-layer:nth-child(1) {
  transform: translate(6px, -6px);
  z-index: 0;
  border-color: rgba(255,255,255,0.1);
}
.game-stack-layer.layer-2 {
  transform: translate(12px, -12px);
  z-index: -1;
  border-color: rgba(255,255,255,0.05);
}
.game-stack-wrapper:hover .game-stack-layer:nth-child(1) {
  transform: translate(12px, -12px) rotate(2deg);
}
.game-stack-wrapper:hover .game-stack-layer.layer-2 {
  transform: translate(24px, -24px) rotate(4deg);
}
.game-stack-wrapper .game-card {
  position: relative !important;
  width: calc(100% - 12px) !important;
  z-index: 2;
  margin: 0 !important;
  margin-top: 12px !important;
}

/* ── GAME CARD ── */
.game-card {
  background: #111118; border: 1px solid transparent;
  border-radius: var(--r2); padding: 18px; cursor: pointer;
  transition: all 0.2s; position: relative;
  display: flex;
  flex-direction: column;
  height: 400px;
  isolation: isolate;
}

/* Ambient blur fill — blurred back layer + sharp front layer for letterboxed images */
.card-bg-clip {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  z-index: -1;
}
.card-bg-blur,
.card-bg-sharp { position: absolute; pointer-events: none; }
.card-bg-blur {
  inset: -15px;
  background-size: 200%; background-position: center;
  filter: blur(18px) saturate(1.3);
  opacity: 0.85;
  z-index: -2;
}
.card-bg-sharp { inset: 0; background-size: cover; background-position: center; z-index: -1; }
.game-card.has-cover { background-color: transparent; }
.game-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent-glow) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.2s;
}
.game-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.5); }
.game-card:hover::before { opacity: 1; }

/* Destaque para jogos não jogados dentro de Franquias */
.game-card.is-grayscale {
  filter: grayscale(1);
  opacity: 0.85;
}
.game-card.is-grayscale:hover {
  filter: grayscale(0.5);
  opacity: 1;
}

/* Destaque para jogos Platinados */
.game-card.is-platinado { box-shadow: 0 0 12px rgba(240,192,96,0.15); }
.game-card.is-platinado:hover { box-shadow: 0 8px 30px rgba(240,192,96,0.4); }
/* Impede as informações do rodapé de ficarem escondidas atrás do troféu */
.game-card.is-platinado .footer-info { padding-right: 90px; }

/* Ícone de Platina no Modo Grade */
@keyframes pop-platina {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

.grid-platina-icon {
  position: absolute;
  top: auto;
  bottom: 12px;
  right: 12px;
  width: 88px;
  height: 88px;
  object-fit: contain;
  z-index: 10;
  pointer-events: none;
  opacity: 0.95;
  filter: drop-shadow(0 0 2px rgba(80,176,240,1))
          drop-shadow(0 0 2px rgba(80,176,240,1))
          drop-shadow(0 6px 14px rgba(0,0,0,0.6));
}

.game-card.is-platinado:hover .grid-platina-icon {
  animation: pop-platina 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Destaque para jogos Nota 10 */
.game-card.is-perfect {
  border-color: rgba(255, 215, 0, 0.75);
  box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.4), 0 0 12px rgba(255, 215, 0, 0.35), 0 0 28px rgba(255, 215, 0, 0.15);
}
.game-card.is-perfect:hover {
  border-color: rgba(255, 215, 0, 1);
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.45), 0 0 0 1px rgba(255, 215, 0, 0.6), 0 0 20px rgba(255, 215, 0, 0.3);
}

@keyframes perfectShine {
  0% { transform: translateX(-50%) rotate(0deg); }
  100% { transform: translateX(50%) rotate(360deg); }
}

.perfect-bg {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: color-dodge;
}
.perfect-bg::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 215, 0, 0.1) 35%, rgba(255, 215, 0, 0.4) 50%, rgba(255, 215, 0, 0.1) 65%, transparent 80%);
  animation: perfectShine 6s infinite linear;
  pointer-events: none;
}

/* Quando tem capa: overlay escuro garante legibilidade em qualquer imagem */
.game-card.has-cover::after {
  content: '';
  position: absolute; inset: 0;
  /* Escuro no topo (nome) e mais escuro ainda na base (footer) */
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.55)  0%,
    rgba(0,0,0,0.25) 35%,
    rgba(0,0,0,0.30) 55%,
    rgba(0,0,0,0.80) 100%
  );
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
}
/* Todo conteúdo fica acima do overlay */
.game-card.has-cover .card-header,
.game-card.has-cover .card-meta,
.game-card.has-cover .card-footer { position: relative; z-index: 1; }

/* Com capa: texto sempre branco + sombra para destacar do overlay */
.game-card.has-cover .game-name {
  color: #fff !important;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}
.game-card.has-cover .nota-val {
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
}
.game-card.has-cover .nota-val.nota-perfect {
  text-shadow: none;
  filter: drop-shadow(0 2px 4px #000) drop-shadow(0 0 10px rgba(255,170,0,0.6));
}
.game-card.has-cover .horas-tag,
.game-card.has-cover .date-tag {
  color: rgba(255,255,255,0.85) !important;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.game-card.has-cover .platina-icon {
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.8));
}
/* Badges e tags com fundo semitransparente escuro — legíveis em qualquer capa */
.game-card.has-cover .status-badge {
  background: rgba(0,0,0,0.55) !important;
  border-color: rgba(255,255,255,0.15) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.game-card.has-cover .status-Zerado     { color: var(--green)  !important; }
.game-card.has-cover .status-Platinado  { color: #f0c060   !important; }
.game-card.has-cover .status-Abandonado { color: var(--red)    !important; }
.game-card.has-cover .status-Jogando    { color: #50b0f0   !important; }
.game-card.has-cover .status-NaoZerado  { color: var(--orange) !important; }
.game-card.has-cover .status-Desejo     { color: var(--pink)   !important; }
.game-card.has-cover .meta-tag {
  background: rgba(0,0,0,0.50) !important;
  border-color: rgba(255,255,255,0.12) !important;
  color: rgba(255,255,255,0.90) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.card-header {
  display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; margin-bottom: 8px;
  height: 44px;
  flex-shrink: 0;
  width: 100%;
  overflow: hidden;
}
.game-card > .status-badges {
  display: flex; gap: 6px; flex-wrap: wrap; width: 100%; overflow: visible; flex-shrink: 0;
  margin-bottom: 8px;
  padding: 4px 2px;
  margin-top: -4px;
}
.game-name {
  font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3; width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta {
  display: flex; gap: 6px; margin-bottom: auto;
  height: 28px;
  padding: 2px 2px;
  margin-top: -2px;
  overflow: visible;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── STATUS BADGES ── */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px; font-size: 10px;
  font-family: 'Syne', sans-serif; font-weight: 600; letter-spacing: 0.5px;
  white-space: nowrap; flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s, background 0.2s;
}
.status-badge:hover {
  transform: scale(1.1);
  z-index: 10;
  box-shadow: 0 4px 12px var(--accent-glow), 0 0 6px var(--accent);
}
.status-Zerado    { background: rgba(80,208,138,0.12); color: var(--green);  border: 1px solid rgba(80,208,138,0.25); }
.status-Platinado { background: rgba(240,192,96,0.12); color: #f0c060;   border: 1px solid rgba(240,192,96,0.25); }
.status-Abandonado{ background: rgba(240,96,112,0.12); color: var(--red);    border: 1px solid rgba(240,96,112,0.25); }
.status-Jogando   { background: rgba(80,176,240,0.12); color: #50b0f0;   border: 1px solid rgba(80,176,240,0.25); }
.status-NaoZerado { background: rgba(240,160,80,0.12); color: var(--orange); border: 1px solid rgba(240,160,80,0.25); }
.status-Desejo    { background: rgba(224,80,224,0.12); color: var(--pink);   border: 1px solid rgba(224,80,224,0.25); }
.status-Backlog   { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent2); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }

/* ── CARD META / FOOTER ── */
.meta-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: #18181f; border-radius: 6px;
  padding: 3px 8px; font-size: 11px; color: var(--text2);
  border: 1px solid var(--border);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s;
}
.meta-tag:hover {
  transform: scale(1.1);
  z-index: 10;
  box-shadow: 0 4px 10px var(--accent-glow), 0 0 5px var(--accent);
}
.meta-tag-console-wrap { position: relative; display: inline-flex; }
.console-tooltip {
  display: none; position: absolute; bottom: calc(100% + 8px); left: 0;
  background: linear-gradient(160deg, rgba(30,30,38,0.98), rgba(18,18,24,0.98));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 10px;
  padding: 8px; min-width: 150px;
  white-space: nowrap; z-index: 20;
  box-shadow: 0 8px 24px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.02);
  backdrop-filter: blur(10px);
  animation: consoleTooltipIn 0.15s ease-out;
}
.console-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 16px;
  width: 9px; height: 9px;
  background: rgba(24,24,30,0.98);
  border-right: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  transform: translateY(-50%) rotate(45deg);
}
.console-tooltip-title {
  font-family: 'Syne', sans-serif; font-size: 9.5px; font-weight: 700;
  color: var(--accent); text-transform: uppercase; letter-spacing: 0.6px;
  padding: 2px 6px 6px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.console-tooltip-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px; border-radius: 6px;
  font-size: 11.5px; color: var(--text2);
  transition: background 0.15s;
}
.console-tooltip-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.console-tooltip-icon {
  width: 18px; height: 18px; object-fit: contain; flex-shrink: 0;
  filter: drop-shadow(0 0 3px rgba(0,0,0,0.6));
}
span.console-tooltip-icon { display: inline-flex; align-items: center; justify-content: center; color: var(--accent); }
span.console-tooltip-icon svg { width: 14px; height: 14px; }
@keyframes consoleTooltipIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.meta-tag-console-wrap:hover .console-tooltip { display: block; }
.card-footer {
  display: flex; align-items: center; justify-content: space-between; margin-top: 12px;
  height: 56px;
  flex-shrink: 0;
}
.footer-info { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 60px; }
.nota-section { display: flex; align-items: center; gap: 14px; }
.nota-val { font-family: 'Syne', sans-serif; font-size: 49px; font-weight: 800; }
.platina-icon { height: 56px; width: 56px; object-fit: contain; }
.nota-0      { color: var(--text3); }
.nota-low    { color: var(--red); }
.nota-mid    { color: var(--orange); }
.nota-good   { color: #f0c060; }
.nota-great  { color: var(--green); }
.nota-perfect{ background: linear-gradient(135deg, #ffef80, #ffaa00); -webkit-background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 2px 8px rgba(255,170,0,0.6)); }
.horas-tag { font-size: 12px; color: var(--text3); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.date-tag  { font-size: 11px; color: var(--text3); white-space: nowrap; }

/* Destaque para jogos que precisam de configura��o (ex: importados da Steam) */
.game-card.needs-review {
  border: 1.5px solid #ff9800 !important;
  box-shadow: 0 0 10px rgba(255, 152, 0, 0.25) !important;
}
.game-card.needs-review:hover {
  border-color: #ffa726 !important;
  box-shadow: 0 8px 24px rgba(255, 152, 0, 0.4) !important;
}
.game-card.needs-review .review-badge {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 16px);
  box-sizing: border-box;
  background: rgba(255, 152, 0, 0.95);
  color: #111;
  font-family: 'Syne', sans-serif;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
