:root {
  --bni-red: #cf2030;
  --bni-red-dark: #a31826;
  --white: #ffffff;
  --light: #f2f2f2;
  --sterling: #c8c8c8;
  --granite: #64666a;
  --black: #000000;
  --ok: #2f9e62;
  --danger: #cf2030;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  background: var(--light);
  color: var(--black);
  font-family: "Montserrat", system-ui, sans-serif;
}

body {
  background-image: linear-gradient(180deg, #ffffff 0%, #f2f2f2 220px);
  border-top: 6px solid var(--bni-red);
}

button,
input,
textarea,
select {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  min-width: 52px;
  height: 42px;
  padding: 0 10px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--bni-red);
  color: var(--white);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.brand h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand p {
  color: var(--granite);
  font-size: 12px;
  margin-top: 2px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--sterling);
  background: var(--white);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--granite);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(47, 158, 98, 0.15);
}

.dot.off {
  background: var(--sterling);
  box-shadow: none;
}

.card {
  background: var(--white);
  border: 1px solid var(--sterling);
  border-radius: 16px;
  padding: 28px;
}

.hero-title {
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.04em;
  margin-bottom: 10px;
  color: var(--black);
}

.lede {
  color: var(--granite);
  font-size: 15px;
  line-height: 1.6;
  max-width: 46ch;
}

.field {
  margin-top: 24px;
}

.field label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--granite);
  font-weight: 600;
  margin-bottom: 8px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--sterling);
  border-radius: 10px;
  padding: 14px 16px;
  outline: none;
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--bni-red);
  box-shadow: 0 0 0 3px rgba(207, 32, 48, 0.12);
}

.hint {
  color: var(--granite);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 8px;
}

.emo-editor {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.emo-edit {
  border: 1px solid var(--sterling);
  border-radius: 12px;
  padding: 12px;
  background: var(--light);
  display: grid;
  gap: 8px;
}

.emo-edit-top {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 8px;
  align-items: center;
}

.emo-edit input,
.emo-edit textarea {
  width: 100%;
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--sterling);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
}

.emo-edit textarea {
  min-height: 64px;
  resize: vertical;
}

.emo-edit input.emoji,
.emo-edit input.pe-emoji {
  font-size: 26px;
  text-align: center;
  padding: 6px;
  cursor: pointer;
  background: var(--light);
  border-color: var(--sterling);
}

.btn-tiny {
  padding: 8px 10px;
  font-size: 12px;
}

.btn {
  border: 0;
  cursor: pointer;
  border-radius: 10px;
  padding: 14px 18px;
  font-weight: 700;
  color: var(--white);
  background: var(--black);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-fire {
  background: var(--bni-red);
  color: var(--white);
  width: 100%;
  margin-top: 16px;
}

.btn-fire:hover {
  background: var(--bni-red-dark);
}

.btn-ghost {
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--sterling);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin-top: 10px;
  font-weight: 600;
}

.question-box {
  margin-bottom: 22px;
}

.question-box small {
  color: var(--bni-red);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}

.question-box h2 {
  font-size: clamp(24px, 4vw, 36px);
  letter-spacing: -0.03em;
  margin-top: 8px;
  line-height: 1.15;
}

.grid {
  display: grid;
  gap: 14px;
}

.emo-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .emo-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.emo {
  text-align: left;
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--sterling);
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 14px;
  align-items: start;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.emo:hover {
  transform: translateY(-2px);
  border-color: var(--bni-red);
}

.emo.selected {
  border-color: var(--bni-red);
  background: #fff5f5;
  box-shadow: inset 0 0 0 1px var(--bni-red);
}

.emo .big {
  font-size: 36px;
  line-height: 1;
}

.emo strong {
  display: block;
  margin-bottom: 4px;
  color: var(--black);
}

.emo span {
  color: var(--granite);
  font-size: 13px;
  line-height: 1.45;
}

.emo.tone-0,
.emo.tone-1,
.emo.tone-2,
.emo.tone-3,
.emo.tone-4,
.emo.tone-5 {
  color: var(--black);
}

.bars {
  display: grid;
  gap: 16px;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.bar-track {
  height: 18px;
  background: var(--light);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--sterling);
}

.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  transition: width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bar-fill.tone-0 { background: #cf2030; }
.bar-fill.tone-1 { background: #a31826; }
.bar-fill.tone-2 { background: #64666a; }
.bar-fill.tone-3 { background: #000000; }
.bar-fill.tone-4 { background: #8e1622; }
.bar-fill.tone-5 { background: #4a4c50; }

.names {
  color: var(--granite);
  font-size: 12px;
  min-height: 16px;
}

.wait {
  text-align: center;
  padding: 48px 12px;
}

.wait .pulse {
  font-size: 48px;
  animation: float 2.2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--sterling);
  padding: 12px 14px;
  border-radius: 12px;
  display: none;
  z-index: 20;
}

.toast.show {
  display: block;
  animation: pop 0.35s ease;
}

@keyframes pop {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.admin-layout {
  display: grid;
  gap: 18px;
}

@media (min-width: 980px) {
  .admin-layout {
    grid-template-columns: 420px 1fr;
    align-items: start;
  }
}

.people {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  font-size: 12px;
  border: 1px solid var(--sterling);
  background: var(--light);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--granite);
}

.stats {
  display: flex;
  gap: 18px;
  margin: 8px 0 18px;
  color: var(--granite);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

/* ── Emoji picker ─────────────────────────────────────────────────────── */
.emoji-picker {
  position: absolute;
  z-index: 999;
  background: var(--white);
  border: 1px solid var(--sterling);
  border-radius: 14px;
  width: 290px;
  padding: 10px;
}

.ep-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--sterling);
  padding-bottom: 8px;
}

.ep-tab {
  border: none;
  background: transparent;
  font-size: 20px;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
}

.ep-tab:hover,
.ep-tab.active {
  background: var(--light);
}

.ep-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  max-height: 200px;
  overflow-y: auto;
}

.ep-emoji-btn {
  border: none;
  background: transparent;
  font-size: 22px;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
  text-align: center;
}

.ep-emoji-btn:hover {
  background: var(--light);
}

/* ── Pestañas ─────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--sterling);
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--granite);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  border-radius: 8px 8px 0 0;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
  color: var(--black);
}

.tab-btn.active {
  color: var(--bni-red);
  border-bottom-color: var(--bni-red);
}

/* ── Editor de mazos ──────────────────────────────────────────────────── */
.preset-card {
  margin-bottom: 18px;
}

.preset-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.preset-emos {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}
