body {
  font-family: sans-serif;
  color: #f9fafb;
}

/* ===== LAYOUT PRINCIPAL ===== */

.minigame-page {
  max-width: 1280px;
  margin: 0 auto 40px;
  padding: 16px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.minigame-main {
  flex: 1;
  min-width: 0;
}

.minigame-sidebar {
  width: 320px;
  flex-shrink: 0;
}

/* ===== HERO DO JOGO ===== */

.game-hero-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.6);
}

.game-hero-left {
  display: flex;
  gap: 16px;
}

.game-thumb {
  width: 150px;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #020617;
  flex-shrink: 0;
}

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

.game-hero-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-title {
  font-size: 24px;
  margin: 0;
}

.game-subtitle {
  margin: 0;
  font-size: 14px;
  color: #cbd5f5;
}

.game-hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

/* Botões de modo (reutilizados pelo JS) */
.mode-btn {
  margin: 0;
  padding: 10px 20px;
  font-size: 15px;
  cursor: pointer;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 2px solid #3b82f6;
  color: #f9fafb;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.mode-btn.primary {
  background: #3b82f6;
}

.mode-btn.secondary {
  background: rgba(59, 130, 246, 0.25);
}

.mode-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.6);
}

.mode-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.game-hero-meta {
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
}

.meta-item {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.meta-label {
  display: block;
  color: #9ca3af;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.meta-value {
  font-weight: 600;
}

.meta-note {
  margin: 0;
  color: #cbd5f5;
}

.meta-ranking {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.ranking-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  font-size: 12px;
}

.ranking-list li {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

.rank-name {
  font-weight: 500;
}

.rank-points {
  font-weight: 600;
}

/* ===== BLOCO DO JOGO 7:4 ===== */

.game-frame-section {
  margin-top: 20px;
}

.game-description {
  font-size: 13px;
  color: #e5e7eb;
  margin-bottom: 8px;
}

.game-frame-7x4 {
  position: relative;
  width: 100%;
  max-width: 780px;       /* referência desktop */
  margin: 0 auto;
  aspect-ratio: 7 / 4;    /* 7:4 = 780x440 */
  background: #020617;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Puzzle dentro do frame */
#puzzle-container {
  display: grid;
  gap: 2px;
  margin: 0 auto;
  border: none;
  box-sizing: border-box;
}

.tile {
  background-size: cover;
  cursor: pointer;
  box-shadow: inset 0 0 2px #fff;
  transition: all 0.2s;
  position: relative;
}

.empty {
  background-image: none;
  background-color: #111827;
  cursor: default;
}

.tile-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  font-weight: bold;
  color: white;
  text-shadow: 1px 1px 2px black;
  pointer-events: none;
  display: none;
}

/* Status (tempo/movimentos) */
.status-box {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 10px 0 10px;
  font-size: 14px;
}

/* Barra de busca (skins) */
.barra-busca {
  border-radius: 56px;
  border: 2px solid rgba(59, 130, 246, 0.6);
  padding: 8px 12px;
  max-width: 400px;
  margin: 0 auto;
  background-color: rgba(15, 23, 42, 0.9);
  display: flex;
}

.barra-busca input {
  border: none;
  outline: none;
  background-color: transparent;
  width: 100%;
  color: white;
}

.barra-busca:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.6);
}

/* ===== DETALHES DO JOGO ===== */

.game-details-card {
  margin-top: 22px;
  padding: 18px 20px;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.game-details-card h2,
.game-details-card h3 {
  margin-top: 0;
}

.game-details-card p {
  margin-top: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}

.game-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 16px;
  margin-bottom: 16px;
}

.info-item {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 13px;
}

.info-label {
  display: block;
  color: #9ca3af;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.info-value {
  font-weight: 500;
}

.controls-list {
  font-size: 14px;
  padding-left: 18px;
}

/* ===== SIDEBAR ===== */

.minigame-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-ad {
  min-height: 260px;
  border-radius: 16px;
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.sidebar-section {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 18px;
  padding: 12px 12px 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.sidebar-title {
  font-size: 14px;
  margin: 0 0 8px;
}

.sidebar-minigame-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-game-card {
  display: flex;
  gap: 8px;
  padding: 6px 6px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.mini-game-card:hover {
  background: rgba(30, 64, 175, 0.7);
  border-color: rgba(59, 130, 246, 0.8);
  transform: translateY(-1px);
}

.mini-game-thumb {
  width: 72px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #020617;
  flex-shrink: 0;
}

.mini-game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-game-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.mini-game-title {
  font-size: 13px;
  font-weight: 600;
}

.mini-game-tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  color: #e5e7eb;
  align-self: flex-start;
}

.mini-game-tag-current {
  background: rgba(59, 130, 246, 0.35);
}

/* ===== MODAIS / ALERTA / VITÓRIA (reaproveitados) ===== */

.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background: #0f1630cc;
}

.modal-content {
  background-color: #0f1630cc;
  margin: 5% auto;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 800px;
  text-align: center;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-content:hover {
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.6);
}

.modal input {
  width: 80%;
  padding: 10px;
  margin-bottom: 20px;
  font-size: 16px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  border: none;
  color: white;
}

.close,
.close-train {
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close-train:hover {
  color: red;
}

.skins-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.skin {
  width: 140px;
}

.skin img {
  width: 100%;
  border-radius: 8px;
}

.skin p {
  margin-top: 4px;
  font-size: 14px;
}

/* Alerta personalizado */
.alerta-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
}

.alerta-conteudo {
  background-color: #1c1c1c;
  color: white;
  padding: 20px;
  border-radius: 10px;
  width: 300px;
  max-width: 90%;
  text-align: center;
  margin: 15% auto;
  position: relative;
  box-shadow: 0 0 10px #000;
}

.alerta-conteudo h3 {
  margin-top: 10px;
  margin-bottom: 10px;
}

.alerta-conteudo p {
  margin-bottom: 20px;
}

.alerta-conteudo button {
  padding: 10px 20px;
  background-color: #fbbf24;
  border: none;
  color: black;
  font-weight: bold;
  cursor: pointer;
  border-radius: 5px;
}

.alerta-fechar {
  position: absolute;
  top: 5px;
  right: 10px;
  color: #aaa;
  font-size: 20px;
  cursor: pointer;
}

/* Modal de vitória */
.victory-modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  color: #e0e0e0;
  font-family: sans-serif;
}

.victory-modal-content {
  background: #262626;
  margin: 12% auto;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  text-align: center;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.4s ease, transform 0.4s ease;
  position: relative;
}

.victory-modal-content.show {
  opacity: 1;
  transform: scale(1);
}

.victory-modal-content h1 {
  font-size: 32px;
  margin-bottom: 10px;
  font-weight: 500;
}

.victory-modal-content p {
  font-size: 18px;
  margin-bottom: 20px;
}

.victory-modal-content button {
  padding: 12px 24px;
  font-size: 16px;
  background: #4caf50;
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
}

.victory-modal-content button:hover {
  background: #66bb6a;
}

.victory-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 26px;
  color: #bbb;
  cursor: pointer;
}

/* ===== RESPONSIVO ===== */

@media (max-width: 1024px) {
  .minigame-page {
    flex-direction: column;
  }

  .minigame-sidebar {
    width: 100%;
  }

  .game-hero-card {
    flex-direction: column;
  }

  .game-hero-meta {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .game-hero-card {
    padding: 14px 12px;
  }

  .game-thumb {
    width: 120px;
  }

  .game-title {
    font-size: 20px;
  }

  .game-frame-7x4 {
    max-width: 100%;
    border-radius: 14px;
  }
}
