/* Dos capas: las animaciones del diseño original (las usa la invitación, que
   pinta todo inline según el skin) y la UI del creador/editor, que tiene
   estética propia y sobria para no pelear con los skins. */

body { margin: 0; background: #111; overflow-x: hidden; }
a { color: inherit; }
* { box-sizing: border-box; }

button { font: inherit; }
button:disabled { cursor: default; opacity: 0.6; }

@keyframes wiggle { 0%,100% { transform: rotate(-3deg) } 50% { transform: rotate(3deg) } }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
@keyframes blink { 0%,49% { opacity: 1 } 50%,100% { opacity: 0.15 } }
@keyframes popIn { 0% { transform: scale(0.6) rotate(-8deg); opacity: 0 } 60% { transform: scale(1.08) rotate(2deg); opacity: 1 } 100% { transform: scale(1) rotate(0); opacity: 1 } }
@keyframes confetti { 0% { transform: translate(0,0) rotate(0); opacity: 1 } 100% { transform: translate(var(--dx),160px) rotate(540deg); opacity: 0 } }
@keyframes shake { 0%,100% { transform: translateX(0) } 25% { transform: translateX(-3px) } 75% { transform: translateX(3px) } }

.hv-shake:hover { animation: shake 0.3s; }
.hv-bob:hover { animation: bob 0.5s ease-in-out infinite; }
.claim-btn:active { transform: translate(2px, 2px); }
.link-underline { text-decoration: underline; text-underline-offset: 2px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 40;
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  animation: popIn 260ms ease-out;
}

/* ---------- UI del creador y del editor ---------- */

.ui {
  --ink: #16151a;
  --soft: #6b6875;
  --line: #e4e1ea;
  --accent: #FF3EA5;
  --paper: #fff;
  background: #FFE94A;
  color: var(--ink);
  font-family: 'Space Grotesk', -apple-system, sans-serif;
}

.ui #app {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px 90px;
}

.hero { padding: 46px 4px 26px; }
.hero.small { padding: 32px 4px 18px; }

.hero-chip {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 14px;
  border: 3px solid #000;
  border-radius: 999px;
  background: #fff;
  box-shadow: 4px 4px 0 #000;
}

.hero h1 {
  font-size: clamp(30px, 6vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 20px 0 10px;
  text-wrap: balance;
}

.hero p { font-size: 17px; line-height: 1.5; margin: 0; max-width: 46ch; text-wrap: pretty; }

.card {
  background: var(--paper);
  border: 3px solid #000;
  border-radius: 20px;
  box-shadow: 6px 6px 0 #000;
  padding: 22px 20px;
  margin-bottom: 20px;
}

.card.warn { background: #fff6d8; }

.card h2 {
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.lead { font-size: 14px; line-height: 1.5; color: var(--soft); margin: 0 0 16px; text-wrap: pretty; }

.field { display: block; margin-top: 14px; }
.field-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }

.field-input {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fbfaff;
  border: 2px solid var(--line);
  border-radius: 12px;
  resize: vertical;
}

.field-input:focus {
  outline: none;
  border-color: var(--ink);
  background: #fff;
}

.field-input::placeholder { color: #a9a5b4; }
.field-hint { font-size: 12.5px; color: var(--soft); margin-top: 6px; line-height: 1.45; }

.check {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 13.5px;
  color: var(--soft);
  margin-top: 2px;
  cursor: pointer;
}
.check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

.row {
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
  display: grid;
  gap: 8px;
}

.row-head { display: flex; align-items: center; justify-content: space-between; }
.row-num { font-size: 12px; font-weight: 700; color: var(--soft); }
.row-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 520px) { .row-grid { grid-template-columns: 1fr; } }

button.primary, a.primary,
button.secondary, a.secondary,
button.danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  cursor: pointer;
  border: 3px solid #000;
}

button.primary, a.primary { background: var(--accent); color: #fff; box-shadow: 4px 4px 0 #000; }
button.secondary, a.secondary { background: #fff; color: var(--ink); font-size: 14px; min-height: 42px; }
button.danger { background: #fff; color: #c00030; border-color: #c00030; font-size: 14px; min-height: 42px; }
button.primary:active, a.primary:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }

button.ghost {
  background: none;
  border: 0;
  padding: 4px 2px;
  font-size: 13px;
  color: var(--soft);
  text-decoration: underline;
  cursor: pointer;
}

button.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.submit-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.form-error { flex: 1 1 100%; color: #c00030; font-size: 14px; font-weight: 700; }

.skins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
@media (max-width: 520px) { .skins { grid-template-columns: 1fr; } }

.skin-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 12px 10px;
  border: 3px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
}
.skin-card.on { border-color: #000; box-shadow: 4px 4px 0 #000; }
.skin-chip { display: block; width: 42px; height: 10px; border-radius: 999px; }
.skin-body { display: block; padding: 8px 10px; border-radius: 10px; }
.skin-body b { display: block; font-size: 14px; }
.skin-body i { display: block; font-size: 11.5px; font-style: normal; opacity: 0.7; margin-top: 2px; line-height: 1.35; }

.guest-add { display: flex; gap: 8px; align-items: stretch; }
.guest-add .field-input { flex: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px 7px 13px;
  font-size: 14px;
  font-weight: 700;
  background: #fbfaff;
  border: 2px solid var(--line);
  border-radius: 999px;
}
.chip button {
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  padding: 0 3px;
  color: var(--soft);
}
.chip button:hover { color: #c00030; }

.empty { font-size: 14px; color: var(--soft); margin-top: 14px; }

.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 10px; }
.stat {
  flex: 1 1 90px;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
}
.stat b { display: block; font-size: 22px; line-height: 1.1; }
.stat i { display: block; font-style: normal; font-size: 12px; color: var(--soft); margin-top: 2px; }

.mine { display: grid; gap: 10px; margin-top: 12px; }
.mine-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.mine-info { flex: 1 1 180px; min-width: 0; }
.mine-info b { display: block; font-size: 16px; }
.mine-info i { display: block; font-style: normal; font-size: 12.5px; color: var(--soft); margin-top: 2px; }
.mine-links { display: flex; gap: 8px; }

.linkbox {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  background: #fbfaff;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-top: 12px;
}
.linkbox code {
  flex: 1 1 220px;
  min-width: 0;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.linkbox-actions { margin-top: 14px; }

.foot { text-align: center; font-size: 13px; color: #6b6875; padding: 10px 0 30px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}
