/* =========================
   RESET & BASE
========================= */
body {
  background-color: #f2f4f7;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  height: 100vh;
  /* Fallback */
  height: 100dvh;
  /* Mobile Friendly */
  overflow: hidden;
  /* Evita scroll en body */
  display: flex;
  flex-direction: column;
}

/* =========================
   TOP BAR (GLOBAL)
========================= */
.top-bar {
  flex-shrink: 0;
  font-size: 14px;
  color: #6c757d;
  background-color: #f2f4f7;
  /* Igual al body */
  z-index: 10;
}

.app-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Para que el scroll sea interno */
  padding-bottom: 5px;
  /* +20px extra para móviles */
}

/* =========================
   CARD PANEL (BLANCO)
========================= */
.card-panel {
  background-color: #ffffff;
  flex: 1;
  padding: 28px 22px;
  border-radius: 5px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);

  overflow-y: auto;
  /* Scroll interno */

  /* Scroll tipo app nativa */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.card-panel::-webkit-scrollbar {
  display: none;
}

/* Specific Lobby Layout */
.lobby-panel.d-flex {
  display: flex !important;
  flex-direction: column;
}

.lobby-content {
  flex: 1;
  /* Pushes everything below to bottom */
}

.lobby-actions {
  flex-shrink: 0;
  margin-top: 15px;
}

.full-height-container {
  flex: 1;
  display: flex;
  max-width: 100% !important;
  /* El alto lo maneja el flex:1 del padre */
  overflow: hidden;
}


/* =========================
   TITLES
========================= */
.title {
  text-align: center;
  font-weight: 700;
  font-size: 26px;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.subtitle {
  text-align: center;
  color: #8a8f98;
  font-size: 14px;
  margin-bottom: 26px;
}

/* =========================
   DIVIDER "O"
========================= */
.divider {
  position: relative;
  text-align: center;
}

.divider span {
  background-color: #fff;
  padding: 0 10px;
  color: #9aa0a6;
  font-size: 13px;
  position: relative;
  z-index: 1;
}

.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background-color: #e1e4e8;
  transform: translateY(-50%);
}

/* =========================
   INPUTS
========================= */
input.form-control {
  border-radius: 10px;
  height: 44px;
  font-size: 14px;
}

input::placeholder {
  letter-spacing: 1px;
}

/* =========================
   BUTTONS
========================= */
.btn {
  border-radius: 10px;
  height: 44px;
  font-size: 14px;
  font-weight: 600;
}

.btn-dark {
  background-color: #111827;
  border: none;
}

.btn-dark:disabled {
  background-color: #9ca3af;
}

.btn-outline-dark {
  border-color: #111827;
  color: #111827;
}

.btn-outline-dark:hover {
  background-color: #111827;
  color: #fff;
}

.btn-danger {
  background-color: #ef4444;
  border: none;
}

.btn-outline-danger {
  border-color: #ef4444;
  color: #ef4444;
}

.btn-outline-danger:hover {
  background-color: #ef4444;
  color: #fff;
}

.btn-success {
  background-color: #22c55e;
  border: none;
}

/* =========================
   SECTIONS
========================= */
.section-title {
  text-align: center;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

/* =========================
   LAST GAMES
========================= */
.last-games {
  font-size: 14px;
  padding: 12px 0;
}

.last-games-scroll {
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 0px;
  /* Scroll sutil */
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

/* =========================
   LOBBY
========================= */
.share-box {
  background-color: #f9fafb;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
}

.game-code {
  background-color: #e4e5e7;
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  padding: 14px 10px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 6px;
  color: #111827;
}

/* =========================
   PLAYERS LIST
========================= */
.players-list {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
}

.player-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 6px 0;
}

.player-item i {
  font-size: 16px;
}

/* =========================
   GAME VIEW
========================= */
.game-area {
  border: 2px dashed #e5e7eb;
  border-radius: 14px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  /* Esto hace que se expanda */
  width: 100%;
}

/* =========================
   MINDGUESS UI
========================= */
.mind-question {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  color: #1a1a1b;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-in-out;
}

#game-timer-bar {
  transition: width 0.1s linear;
}

.option-btn {
  padding: 18px;
  font-size: 18px;
  border-radius: 12px;
  border: 4px solid #f2f4f7;
  background: white;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60px;
}

.option-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border-color: #e4e5e7;
}

.option-btn.selected {
  border-color: #25D366;
  background-color: #e7f9ee;
  color: #0b7132;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.2);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Ranking styles */
.ranking-item {
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 10px;
  background: #f8f9fa;
  border: none !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ranking-item:nth-child(1) {
  background: #fff9e6;
  border: 2px solid #ffda6a !important;
}

.rank-number {
  font-weight: 800;
  font-size: 18px;
  width: 30px;
}

.rank-name {
  flex: 1;
  text-align: left;
  padding-left: 10px;
}

.rank-score {
  font-weight: 700;
  color: #111827;
}


/* =========================
   RESPONSIVE
========================= */
@media (min-width: 768px) {
  .app-wrapper {
    max-width: 500px;
    margin: 0 auto;
  }
}