:root {
  --blue: #2f8bff;
  --cyan: #21d4c4;
  --green: #35d07f;
  --yellow: #ffd23f;
  --orange: #ff8a3d;
  --pink: #ff5d8f;
  --ink: #2a2340;
  --card: #ffffff;
  --line: #ece7f7;
}

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

body {
  font-family: "Baloo Paaji 2", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 15% -10%, #eafaff 0%, transparent 60%),
    radial-gradient(1000px 600px at 110% 10%, #fff0f6 0%, transparent 55%),
    linear-gradient(180deg, #fbfbff 0%, #f4f2ff 100%);
  min-height: 100vh;
  padding: 18px 16px 60px;
  text-align: center;
}

.home {
  position: fixed;
  top: 14px;
  left: 16px;
  text-decoration: none;
  color: var(--ink);
  opacity: 0.55;
  font-weight: 600;
}
.home:hover { opacity: 1; }

.hero {
  max-width: 620px;
  margin: 26px auto 8px;
}
h1 {
  font-size: clamp(2.1rem, 6vw, 3.1rem);
  font-weight: 700;
  line-height: 1.05;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--green), var(--yellow), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead {
  margin-top: 10px;
  color: #6a6285;
  font-weight: 500;
  font-size: 1.02rem;
}

/* ---- Mesa de combinación ---- */
.bench {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 26px auto 6px;
}
.slot {
  width: 116px;
  height: 116px;
  border-radius: 22px;
  background: var(--card);
  border: 3px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: default;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 24px rgba(60, 40, 120, 0.06);
  padding: 6px;
}
.slot .emoji { font-size: 2.6rem; line-height: 1; }
.slot .name { font-weight: 600; font-size: 0.92rem; }
.slot .empty { font-size: 2.4rem; opacity: 0.25; }
.slot.filled { border-color: var(--cyan); }
.slot.result { border-style: dashed; }
.slot.result.filled { border-style: solid; border-color: var(--orange); }
.slot.pop { animation: pop 0.35s ease; }
.slot.loading .empty { animation: spin 0.9s linear infinite; opacity: 0.6; }

@keyframes pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.op {
  font-size: 1.8rem;
  font-weight: 700;
  color: #b7aee0;
}

.reset {
  margin-left: 6px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--orange));
  box-shadow: 0 8px 18px rgba(255, 93, 143, 0.35);
  transition: transform 0.1s ease;
}
.reset:hover { transform: rotate(-25deg); }

.status {
  color: #8a83a6;
  font-weight: 500;
  min-height: 1.4em;
  margin: 8px 0 4px;
}

/* ---- Codex / paleta ---- */
.codex {
  max-width: 860px;
  margin: 22px auto 0;
  background: var(--card);
  border: 3px solid var(--line);
  border-radius: 26px;
  padding: 16px 16px 22px;
  box-shadow: 0 16px 40px rgba(60, 40, 120, 0.07);
}
.codex-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}
.codex-head h2 { font-size: 1.15rem; font-weight: 700; }
.count {
  background: linear-gradient(135deg, var(--green), var(--cyan));
  color: #fff;
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
}

.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fbfaff;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.98rem;
  transition: transform 0.1s ease, border-color 0.12s ease, background 0.12s ease;
  user-select: none;
}
.chip:hover { transform: translateY(-2px); border-color: var(--cyan); }
.chip:active { transform: translateY(0) scale(0.96); }
.chip .e { font-size: 1.25rem; }
.chip.base { background: linear-gradient(135deg, #eafaff, #fff7e6); }
.chip.new { animation: glow 1.6s ease; border-color: var(--yellow); }

@keyframes glow {
  0% { box-shadow: 0 0 0 0 rgba(255, 210, 63, 0.8); }
  100% { box-shadow: 0 0 0 16px rgba(255, 210, 63, 0); }
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 14px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
