/* ============================
   QSDC MULTI - CSS UNIFICADO (Game-first)
   Aplica a: index, lobby, game, results
============================ */

/* RESET */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: clamp(16px, 2vw, 24px);
}

body {
  font-family: Arial, sans-serif;
  background-color: #f0f0f0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  color: #111;
}

/* CONTENEDOR PRINCIPAL */
#app {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  text-align: center;
}

h1 {
  font-size: clamp(1.5rem, 5vw, 3rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

/* CARDS */
.card {
  background: #fff;
  border-radius: 0.6rem;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 0 0.55rem rgba(0, 0, 0, 0.10);
  width: 100%;
  text-align: center;
}

.card p + p {
  margin-top: 0.35rem;
}

.hint {
  opacity: 0.9;
}

/* FILAS / BOTONERAS */
.row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
  flex-wrap: wrap;
  align-items: stretch;
}

/* INPUTS / SELECTS */
input,
select {
  width: 100%;
  max-width: 360px;
  padding: 10px 12px;
  margin: 8px auto;
  display: block;
  font-size: 1rem;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 0.45rem;
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(0,0,0,0.35);
}

/* AUDIO */
#audio {
  display: block;
  margin: 0.5rem auto;
  max-width: 300px;
  width: 100%;
}

/* DESCRIPCIÓN */
.description {
  text-align: left;
  max-width: 420px;
  margin: 0.2rem auto 0 auto;
  line-height: 1.35;
}

/* HINTS CONTAINER */
#hintsContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 300px;
  margin: 0.5rem auto 0 auto;
  gap: 0.5rem;
}

#hintsContainer > button,
#hintsContainer > div {
  width: 100%;
  max-width: 90%;
  font-size: 1rem;
}

#hintsContainer > div {
  display: none; /* JS alterna */
  padding: 0.65rem 0.75rem;
  border-radius: 0.45rem;
  background: #f4f4f4;
  text-align: left;
  line-height: 1.3;
  border: 1px solid rgba(0,0,0,0.10);
}

/* RESPUESTA (fila input + botón) */
.answer-row {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* ya no centrado */
  gap: 0.6rem;
  margin: 0.6rem auto 0 auto;
  max-width: 420px;            /* encaja con description */
}

.answer-row #btnAnswer {
  min-width: auto;       /* rompe el 150px */
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  white-space: nowrap;
  min-height: 20px;
}



#answerInput {
  flex: 1;               /* ocupa todo lo posible */
  min-width: 0;          /* evita overflow en móvil */
  height: 2.4rem;
  font-size: 1.05rem;
  margin: 0;
}


/* ============================
   BOTONES (unificados)
============================ */

button {
  border: none;
  border-radius: 0.5rem;
  background: #e6e6e6;
  transition: transform 0.03s ease, background 0.15s ease, opacity 0.15s ease;
  cursor: pointer;

  /* look consistente */
  padding: 0.9rem 1rem;
  font-size: 1rem;
  line-height: 1;
  min-height: 44px; /* tactil */
}

button:hover {
  background: #dcdcdc;
}

button:active {
  transform: scale(0.99);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.primary {
  font-weight: 700;
  background: #d9d9d9;
}

.primary:hover {
  background: #cfcfcf;
}

.secondary {
  background: #e6e6e6;
}

/* Botones concretos de game para que “encajen” */
#btnAnswer,
#btnSurrender,
#btnBack,
#btnStart,
#btnLeave,
#btnHome,
#btnLobby,
#btnCopyRoom {
  min-width: 150px;
}

/* Card + botón debajo (ej. copiar ID) */
.card button {
  margin-top: 0.6rem;
}

/* ERRORES */
.error {
  color: #c00;
  font-weight: 700;
}

/* ESTADO RESPUESTA */
.correcto,
.incorrecto {
  font-weight: bold;
  font-size: 1.3rem;
  text-shadow: 0 0 1px black;
}

.correcto { color: green; }
.incorrecto { color: red; }

/* ============================
   LISTAS: lobby/game
============================ */

#playersList,
#scoreList {
  list-style: none;
  padding-left: 0;
  margin-top: 0.6rem;
  display: grid;
  gap: 8px;
}

#playersList li,
#scoreList li {
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.65);
  font-weight: 700;
}

/* Room ID */
#roomIdText {
  font-weight: 900;
  letter-spacing: 0.08em;
}

/* Lobby: Start más “jefe final” cuando aparece */
#btnStart {
  font-size: 1.05rem;
  padding: 1rem 1rem;
}

/* ============================
   HOME (index)
============================ */

.title {
  font-size: clamp(1.6rem, 6vw, 3rem);
  margin-bottom: 0.35rem;
}

.subtitle {
  opacity: 0.85;
  margin-bottom: 1rem;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0.8rem auto 0.6rem auto;
  width: 100%;
  max-width: 360px;
}

.home-actions button {
  width: 100%;
}

/* Labels */
label {
  display: block;
  margin: 0.6rem auto 0.15rem auto;
  width: 100%;
  max-width: 360px;
  text-align: left;
  font-weight: 700;
  opacity: 0.9;
}

/* ============================
   RESULTS (ranking con números reales)
   Mantiene <ol> con numeración ✅
============================ */

ol#resultsList {
  padding-left: 1.35rem; /* deja sitio para 1. 2. 3. */
  text-align: left;
  margin-top: 0.8rem;
  display: grid;
  gap: 10px;
}

ol#resultsList li {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.65);
  font-weight: 800;
}

/* Top 1 un poco más destacado */
ol#resultsList li:first-child {
  border-width: 2px;
}

/* ============================
   DARK MODE (body.dark-mode)
============================ */

body.dark-mode {
  background-color: #0d1b2a;
  color: #e0e1dd;
}

body.dark-mode .card {
  background-color: #1b263b;
  color: #e0e1dd;
  box-shadow: 0 0 0.7rem rgba(0,0,0,0.25);
}

body.dark-mode input,
body.dark-mode select {
  background-color: #1b263b;
  color: #e0e1dd;
  border-color: rgba(255,255,255,0.18);
}

body.dark-mode button {
  background-color: #415a77;
  color: #e0e1dd;
}

body.dark-mode button:hover {
  background-color: #3a506b;
}

body.dark-mode #hintsContainer > div {
  background-color: #778da9;
  color: #0d1b2a;
  border-color: rgba(0,0,0,0.12);
}

body.dark-mode #playersList li,
body.dark-mode #scoreList li,
body.dark-mode ol#resultsList li {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255,255,255,0.16);
}

/* ============================
   AJUSTES GAME: pistas + rendirse
============================ */

/* Botones de pistas: un poco más compactos */
#hintsContainer > button {
  padding: 0.55rem 0.8rem;
  font-size: 0.95rem;
  min-height: 38px;
}

/* Rendirse: más pequeño todavía (que no "grite" como opción) */
#btnSurrender {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  min-height: 20px;
  min-width: 20px;
  opacity: 0.85;
}

/* Si quieres que el hover no lo haga destacar tanto */
#btnSurrender:hover {
  opacity: 1;
}
#buzzerRow {
  justify-content: center;
  align-items: center;
  gap: 12px;
}

#btnBuzz {
  min-width: 150px;
}
ul {
  list-style: none;
  padding-left: 0;
}

