:root {
  /* Paleta clara */
  --bg: #f4f7fb;
  --panel: #ffffff;
  --muted: #5b6b7f;
  --text: #0f172a;
  --primary: #3b82f6;      /* azul */
  --primary-600: #2563eb;
  --ghost: #e9eef7;
  --accent: #0ea5e9;
  --danger: #ef4444;
  --warning: #f59e0b;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background:
    radial-gradient(1400px 700px at -10% -20%, rgba(209, 227, 255, 0.55) 0%, rgba(209,227,255,0) 55%),
    radial-gradient(1100px 750px at 120% 10%, rgba(180, 198, 230, 0.45) 0%, rgba(180,198,230,0) 60%),
    var(--bg);
}

.app-header {
  padding: 24px 16px 8px;
  text-align: center;
}

.app-header h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.app-main {
  padding: 16px;
  max-width: 900px;
  margin: 0 auto 48px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.card {
  background: var(--panel);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.06);
  backdrop-filter: blur(4px);
}

.card h2 {
  margin: 0 0 12px 0;
  font-size: 22px;
}

.block-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

.players-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.player-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.input, .select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  background: #ffffff;
  color: var(--text);
}

.input:focus, .select:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.7);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.btn {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #f0f4fa;
  color: #0f172a;
  cursor: pointer;
}

.btn:hover { opacity: 0.98; filter: brightness(1.05); }

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

.btn-primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-600));
  border-color: rgba(37, 99, 235, 0.8);
  color: #ffffff;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(0,0,0,0.15);
}

.btn-ghost {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
}

.btn-danger {
  background: var(--danger);
  border-color: #b91c1c;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.28);
}

.players-actions, .setup-actions, .reveal-actions, .play-actions, .results-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.theme-setup { margin-top: 16px; }

.reveal-status {
  margin: 4px 0 8px;
  color: var(--muted);
}

.current-player { margin: 8px 0; }

.reveal-panel {
  margin: 12px 0;
  border: 2px dashed rgba(15, 23, 42, 0.2);
  border-radius: 12px;
  padding: 28px 16px;
  text-align: center;
}

.reveal-content {
  font-size: 20px;
  letter-spacing: 1px;
}

.hint { color: var(--muted); margin-top: 0; }

.muted { color: var(--muted); font-size: 12px; }

.play-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.theme-line { color: var(--muted); margin: 6px 0 0; }

.turn-info { margin: 12px 0; }

.play-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 12px;
}
.play-left { min-width: 0; }
.play-right { min-width: 0; }

.chat {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  max-height: 40vh;
  overflow: auto;
  background: #ffffff;
}

.chat-log .bubble-self {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  padding: 8px 10px;
}
.chat-log .bubble-other {
  background: #eaf3ff;
  border: 1px solid #f5b3c7;
  border-radius: 10px;
  padding: 8px 10px;
}
.chat-log .bubble-system {
  color: var(--muted);
  font-size: 12px;
  padding: 6px 8px;
}
.chat-log {
  list-style: none;
  margin: 0;
  padding: 8px;
}

.chat-item {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.chat-item:last-child { border-bottom: none; }

.chat-item .author {
  color: var(--accent);
  font-weight: 600;
  margin-right: 8px;
}

.hint-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 10px;
}

.app-footer {
  text-align: center;
  color: var(--muted);
  padding: 24px 16px 32px;
}

/* Votación */
.vote-status { margin: 6px 0 8px; color: var(--muted); }
.candidates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.candidates .btn { width: 100%; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.open { display: flex; }

.modal-card {
  width: min(92vw, 480px);
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 18px 40px rgba(2,6,23,0.12);
}

.modal-card h3 { margin: 0 0 8px; font-size: 18px; }
.modal-card p { margin: 6px 0 12px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Banner simple */
.banner {
  padding: 8px 12px;
  border-radius: 10px;
}
.banner.warn { background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.35); color: #fde68a; }
.banner.error { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.35); color: #fecaca; }

@media (min-width: 640px) {
  .players-container {
    grid-template-columns: 1fr 1fr;
  }
}


