@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap");

:root {
  --bg-gradient-1: #ff9a9e;
  --bg-gradient-2: #fad0c4;
  --bg-gradient-3: #fbc2eb;
  --bg-gradient-4: #a18cd1;
  --card-bg: rgba(255, 255, 255, 0.97);
  --primary: #ff4b93;
  --primary-dark: #e13378;
  --secondary: #ffb347;
  --secondary-dark: #ff9a2b;
  --text-color: #35224b;
  --error: #e53935;
  --radius-lg: 24px;
  --shadow-soft: 0 22px 50px rgba(0, 0, 0, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--text-color);
  min-height: 100vh;
  background: #fbe9e7;
  overflow-x: hidden;
}

/* Fondo degradado */
.background-gradient {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top left, var(--bg-gradient-1), transparent 55%),
    radial-gradient(circle at top right, var(--bg-gradient-3), transparent 55%),
    radial-gradient(circle at bottom, var(--bg-gradient-4), transparent 60%);
  opacity: 0.95;
  z-index: -1;
  animation: bgMove 15s ease-in-out infinite alternate;
}

/* Layout principal */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-container {
  width: 100%;
  max-width: 520px;
  padding: 18px 16px 24px;
  margin: 0 auto;
  flex: 1;
}

.header {
  text-align: center;
  color: #fff;
  margin-bottom: 18px;
  text-shadow: 0 3px 9px rgba(0, 0, 0, 0.35);
}

.header h1 {
  margin: 0;
  font-size: 2.1rem;
  line-height: 1.2;
}

.subtitle {
  margin: 8px 0 0;
  font-size: 0.96rem;
}

.card {
  background: linear-gradient(145deg, #ffffff, #fff6ff);
  border-radius: var(--radius-lg);
  padding: 20px 18px 22px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(14px);
  display: none;
  animation: fadeUp 0.4s ease;
}

.card.active {
  display: block;
}

h2 {
  margin-top: 0;
  font-size: 1.5rem;
  text-align: center;
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.field span {
  margin-bottom: 4px;
  font-weight: 600;
}

input[type="text"] {
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  padding: 11px 15px;
  font-size: 1rem;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s, transform 0.1s;
  background: linear-gradient(135deg, #fff, #ffeaf5);
}

input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 75, 147, 0.25);
  transform: translateY(-1px);
}

.actions {
  margin-top: 12px;
}

.btn {
  border-radius: 999px;
  padding: 11px 16px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
}

.btn:active {
  transform: translateY(1px) scale(0.985);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}

.btn.primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark));
}

.btn.secondary {
  background: #fff;
  color: var(--primary-dark);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.btn.secondary:hover {
  background: #ffe9f3;
}

.btn.full {
  width: 100%;
}

.separator {
  text-align: center;
  margin: 12px 0 8px;
  font-size: 0.8rem;
  color: #777;
  position: relative;
}

.separator::before,
.separator::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
}

.separator::before {
  left: 0;
}

.separator::after {
  right: 0;
}

.note,
.small {
  font-size: 0.8rem;
  text-align: center;
  color: #666;
}

.small-top {
  margin-top: 0;
  margin-bottom: 6px;
}

.error {
  color: var(--error);
  font-size: 0.8rem;
  margin-top: 6px;
  text-align: center;
}

.room-code {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  text-align: center;
  padding: 12px 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff5f7, #ffe3fb);
  border: 1px dashed rgba(255, 75, 147, 0.7);
  margin: 12px 0 8px;
}

/* GAME VIEW */

.game-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 10px;
  color: #555;
}

.room-label span,
.round-label span {
  font-weight: 700;
}

.players {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.player {
  flex: 1;
  background: linear-gradient(135deg, #ffe4f1, #ffffff);
  border-radius: 18px;
  padding: 8px 10px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.86rem;
  position: relative;
  overflow: hidden;
}

.player::before {
  content: "❤";
  position: absolute;
  top: -8px;
  right: 10px;
  font-size: 1rem;
  opacity: 0.35;
}

.player-name {
  font-weight: 600;
}

.player-score {
  margin-top: 4px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.question-box {
  background: linear-gradient(135deg, #fff7e9, #ffe3ec);
  border-radius: 18px;
  padding: 16px 14px;
  text-align: center;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 10px 24px rgba(255, 143, 188, 0.25);
}

/* OPCIONES MULTIPLE CHOICE – DISEÑO BONITO */

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0 12px;
}

.option-btn {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  position: relative;
  border-radius: 18px;
  padding: 9px 12px 9px 14px;
  font-size: 0.85rem;
  background: radial-gradient(circle at top left, #ffffff, #ffe9f7);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease,
    background 0.15s ease, border-color 0.15s ease;
  text-align: left;
  overflow-wrap: anywhere;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4a235a;
}

/* Circulito decorativo a la izquierda */
.option-btn::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #ffd1e3, #ff85b8);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
}

/* Corazoncito tenue a la derecha */
.option-btn::after {
  content: "❤";
  font-size: 0.65rem;
  opacity: 0.15;
  position: absolute;
  right: 10px;
  bottom: 6px;
}

/* Seleccionada */
.option-btn.selected {
  background: linear-gradient(135deg, #ff82c4, #ffb347);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(255, 101, 165, 0.45);
  transform: translateY(-1px);
}

.option-btn.selected::before {
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.option-btn.selected::after {
  opacity: 0.6;
}

.option-btn:active {
  transform: translateY(1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

/* En móviles, una sola columna de opciones */
@media (max-width: 480px) {
  .options-grid {
    grid-template-columns: 1fr;
  }
}

/* RESULTADOS DE LA RONDA */

.answers {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.answers > div {
  flex: 1;
  min-width: 0;
}

.answers p {
  background: linear-gradient(135deg, #ffffff, #ffe7f0);
  border-radius: 14px;
  padding: 8px 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  border-left: 3px solid rgba(255, 75, 147, 0.7);
  margin: 0;
  overflow-wrap: anywhere;
}

/* Nombre del jugador en negrita roja + ':' */
.answer-name {
  font-weight: 700;
  color: #ff1744;
}

/* Texto de la respuesta */
.answer-text {
  color: #4a235a;
}

/* En móviles, respuestas una debajo de otra */
@media (max-width: 480px) {
  .answers {
    flex-direction: column;
  }
}

.result-message {
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 10px;
}

.hidden {
  display: none;
}

/* Final view */

#final-scores {
  margin: 10px 0;
  font-size: 0.95rem;
}

#final-scores p {
  margin: 4px 0;
}

/* FOOTER CENTRADO EN PC Y MÓVIL */

.footer {
  margin-top: auto;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  padding: 8px 16px 12px;
}

.footer p {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.footer strong {
  font-weight: 700;
}

/* Respeta notch / barra inferior en iPhone */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
/* FOOTER CENTRADO Y MÁS ARRIBA */

.footer {
  margin-top: auto;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  /* menos padding abajo para que no quede tan lejos */
  padding: 6px 16px 6px;
}

.footer p {
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  /* color más visible sobre el degradado */
  color: #5b2c6f; /* morado oscuro */
  font-weight: 500;
  text-shadow: none; /* sin sombra para que se vea nítido */
}

.footer strong {
  font-weight: 700;
  color: #e13378; /* resaltar "Anthony POMA" en rosa fuerte */
}

/* QUITAMOS el extra de safe-area para que no se vaya tan abajo */
/*
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

/* Ajuste del footer solo para celular */
@media (max-width: 600px) {
  .footer {
    margin-top: 16px;    /* en lugar de auto, solo un espacio normal */
    padding-bottom: 12px;/* un poco de aire, pero sin pegarse al borde */
  }
}

*/
