:root {
  --oxxo-red: #e4032e;
  --oxxo-yellow: #ffd200;
  --bg: #f5f5f7;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --card: #ffffff;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header.top {
  background: var(--oxxo-red);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header.top .brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

header.top .brand span {
  color: var(--oxxo-yellow);
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

h1.titulo {
  font-size: 1.4rem;
  line-height: 1.35;
  margin: 0 0 8px;
}

.subtitulo {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.opciones {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

button.opcion,
input[type="submit"] {
  border: 2px solid var(--oxxo-red);
  background: #fff;
  color: var(--oxxo-red);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

button.opcion:active,
input[type="submit"]:active {
  transform: scale(0.98);
}

button.opcion.activa,
button.opcion[data-selected="true"] {
  background: var(--oxxo-red);
  color: #fff;
}

.escala-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.escala-row button.opcion {
  flex: 1;
  text-align: center;
  padding: 18px 0;
  font-size: 1.2rem;
}

.escala-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 6px;
}

input[type="text"] {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius);
  border: 2px solid #ddd;
  font-size: 1.05rem;
  margin-bottom: 14px;
}

.confirmacion {
  text-align: center;
  padding: 40px 20px;
}

.confirmacion .check {
  font-size: 3rem;
  margin-bottom: 12px;
}

.espera {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.espera .icono {
  font-size: 3rem;
  margin-bottom: 16px;
}

/* --- Display / proyector --- */

body.display {
  background: #111;
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.display main {
  max-width: 1100px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.display h1.titulo {
  font-size: 2.1rem;
  color: #fff;
  text-align: center;
}

.display .subtitulo {
  text-align: center;
  color: #bbb;
  font-size: 1.05rem;
}

.display .total {
  text-align: center;
  color: var(--oxxo-yellow);
  font-weight: 700;
  margin-bottom: 24px;
}

.barra-fila {
  margin-bottom: 18px;
}

.barra-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.barra-track {
  background: #333;
  border-radius: 8px;
  height: 28px;
  overflow: hidden;
}

.barra-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--oxxo-red), var(--oxxo-yellow));
  border-radius: 8px;
  transition: width 0.4s ease;
  min-width: 2px;
}

.nube {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 20px;
}

.nube span {
  font-weight: 700;
  color: var(--oxxo-yellow);
  line-height: 1;
}

.nube span:nth-child(3n) {
  color: #ffffff;
}

.nube span:nth-child(5n) {
  color: var(--oxxo-red);
}

/* --- Admin --- */

table.admin {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
}

table.admin th,
table.admin td {
  padding: 12px 14px;
  border-bottom: 1px solid #eee;
  text-align: left;
  font-size: 0.92rem;
}

table.admin tr.activa {
  background: #fff4f4;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge.activa {
  background: var(--oxxo-red);
  color: #fff;
}

.badge.inactiva {
  background: #e5e5e5;
  color: #666;
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn.activar {
  background: var(--oxxo-red);
  color: #fff;
}

.btn.pausar {
  background: #444;
  color: #fff;
}

.btn.reset {
  background: #fff;
  color: var(--oxxo-red);
  border: 2px solid var(--oxxo-red);
}

.admin-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.login-box {
  max-width: 360px;
  margin: 80px auto;
}

.error {
  color: var(--oxxo-red);
  margin-bottom: 12px;
}

.top-link {
  color: #fff;
  text-decoration: underline;
  font-size: 0.85rem;
}
