/* Estilos generales: tema oscuro navideño, responsive para móvil. */
:root {
  --bg: #15152a;
  --card: #1f2040;
  --accent: #f5c542;
  --accent-2: #e63946;
  --text: #f1f1f6;
  --muted: #9a9ab5;
  --ok: #2a9d8f;
  --danger: #ef476f;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at top, #2a2250 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #2d2d52;
}

header h1 { font-size: 1.15rem; margin: 0; }
header .who { color: var(--muted); font-size: 0.9rem; }

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 18px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

h2 { font-size: 1.1rem; margin: 0 0 12px; }

button {
  font: inherit;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  background: var(--accent);
  color: #1b1b2f;
  font-weight: 700;
  transition: transform 0.05s ease, opacity 0.2s;
}
button:hover { transform: translateY(-1px); }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
button.secondary { background: #34345c; color: var(--text); font-weight: 600; }
button.danger { background: var(--danger); color: #fff; }

input, select {
  font: inherit;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid #3a3a66;
  background: #171733;
  color: var(--text);
  width: 100%;
}

label { display: block; font-size: 0.9rem; color: var(--muted); margin: 10px 0 6px; }

.error { color: var(--danger); font-size: 0.9rem; min-height: 1.2em; margin-top: 8px; }
.ok { color: var(--ok); }
.muted { color: var(--muted); font-size: 0.9rem; }

/* ----- Pestañas ----- */
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs button { flex: 1; background: #2a2a50; color: var(--text); }
.tabs button.active { background: var(--accent); color: #1b1b2f; }
.hidden { display: none !important; }

/* ----- Ruleta ----- */
.wheels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  justify-items: center;
}
@media (min-width: 680px) {
  .wheels { grid-template-columns: 1fr 1fr; }
}
.wheel-box { position: relative; width: 100%; max-width: 360px; text-align: center; }
.wheel-box h3 { font-size: 0.95rem; color: var(--muted); margin: 6px 0 10px; font-weight: 600; }
.wheel-box canvas { width: 100%; aspect-ratio: 1 / 1; display: block; }

/* Puntero triangular fijo arriba del canvas */
.pointer {
  position: absolute;
  top: 34px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 22px solid var(--accent);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.5));
  z-index: 2;
}

.spin-row { display: flex; justify-content: center; margin: 18px 0 6px; }
.spin-row button { font-size: 1.1rem; padding: 14px 40px; }

.reveal {
  text-align: center;
  padding: 16px;
  border-radius: var(--radius);
  background: #2b2456;
  border: 2px dashed var(--accent);
  margin-top: 14px;
  animation: pop 0.4s ease;
}
.reveal .big { font-size: 1.3rem; font-weight: 800; color: var(--accent); }
@keyframes pop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ----- Chat ----- */
.chat-log {
  height: 52vh;
  min-height: 280px;
  overflow-y: auto;
  background: #141430;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg { max-width: 78%; padding: 8px 12px; border-radius: 12px; background: #2d2d55; word-wrap: break-word; }
.msg .author { font-size: 0.75rem; color: var(--accent); font-weight: 700; margin-bottom: 2px; }
.msg .time { font-size: 0.68rem; color: var(--muted); margin-top: 3px; text-align: right; }
.msg.mine { align-self: flex-end; background: #3a2f6e; }
.msg.system { align-self: center; background: transparent; color: var(--muted); font-size: 0.85rem; }

.chat-form { display: flex; gap: 8px; margin-top: 10px; }
.chat-form input { flex: 1; }

textarea {
  font: inherit; width: 100%; resize: vertical;
  padding: 11px 12px; border-radius: 10px;
  border: 1px solid #3a3a66; background: #171733; color: var(--text);
}
.idea { padding: 10px 0; border-bottom: 1px solid #34345c; white-space: pre-wrap; word-wrap: break-word; }
.idea .by { display: block; font-size: 0.78rem; color: var(--accent); font-weight: 700; }

/* ----- Deseos y apuestas ----- */
.wish-field { margin-bottom: 14px; }
.wish-field .bluff { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; font-size: 0.85rem; }
.wish-field .bluff input { width: auto; }
.guess-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.guess-row select { flex: 1; min-width: 120px; width: auto; }
.pair-line { padding: 8px 0; border-bottom: 1px solid #34345c; font-size: 0.95rem; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 0.75rem; font-weight: 700; }
.tag.true { background: var(--ok); color: #fff; }
.tag.bluff { background: var(--danger); color: #fff; }

/* ----- Auth ----- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 18px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { text-align: center; font-size: 1.4rem; margin-top: 0; }
.auth-card form button { width: 100%; margin-top: 16px; }
.auth-card .links { text-align: center; margin-top: 14px; font-size: 0.9rem; }
.auth-card a { color: var(--accent); }
