/* Customer site styles on top of the compiled Tailwind (web/css/tw.css). Her original rules first. */
* {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
body {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-user-select: none;
  user-select: none;
}
input, textarea, .select-all, #copy-text { -webkit-user-select: text; user-select: text; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
@keyframes magicBling {
  0% { transform: scale(0.5); opacity: 0; filter: brightness(1); }
  50% { transform: scale(1.4); opacity: 1; filter: brightness(2) drop-shadow(0 0 15px gold); }
  100% { transform: scale(1); opacity: 1; filter: brightness(1); }
}
.bling-effect { animation: magicBling 0.8s ease-in-out; }

/* Visible focus for keyboard users (pinch-zoom stays on: no maximum-scale in the viewport). */
button:focus-visible, a:focus-visible, [role="tab"]:focus-visible, input[type=checkbox]:focus-visible {
  outline: 2px solid #EC4899;
  outline-offset: 2px;
}

/* Bracelet stage */
.kbd-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y pinch-zoom; }
.kbd-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.kbd-badge, .kbd-remove {
  position: absolute; left: 0; top: 0; pointer-events: auto; border: 0; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff;
  transition: opacity .2s, box-shadow .2s, background-color .2s;
  will-change: transform;
}
/* 16px visual like the old badges, 28px tap area */
.kbd-badge { width: 18px; height: 18px; border-radius: 999px; background: #EC4899; font-size: 9px; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.kbd-badge::before, .kbd-remove::before { content: ""; position: absolute; inset: -6px; border-radius: 999px; }
.kbd-badge.is-selected { background: #DB2777; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #F472B6; }
.kbd-remove { width: 16px; height: 16px; border-radius: 999px; background: #EF4444; font-size: 9px; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.kbd-toast {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: #EC4899; color: #fff;
  font-weight: 700; font-size: 12px; padding: 6px 12px; border-radius: 999px; opacity: 0;
  transition: opacity .25s; pointer-events: none; white-space: nowrap; z-index: 30;
}
.kbd-toast.show { opacity: 1; }
.kbd-gtoast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px);
  max-width: min(92vw, 420px); background: #fff; color: #DB2777; border: 1px solid #FBCFE8;
  box-shadow: 0 10px 30px rgba(236,72,153,.25); font-weight: 700; font-size: 12px; text-align: center;
  padding: 10px 16px; border-radius: 18px; opacity: 0; pointer-events: none; z-index: 70;
  transition: opacity .25s, transform .25s;
}
.kbd-gtoast.show { opacity: 1; transform: translate(-50%, 0); }
.kbd-gtoast.error { color: #B91C1C; border-color: #FECACA; }
.kbd-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.charm-btn { position: relative; }
.charm-btn[aria-disabled="true"] { cursor: not-allowed; }
.charm-btn[aria-disabled="true"] img { filter: grayscale(1); opacity: .45; }
.charm-tag {
  position: absolute; top: -5px; right: -4px; font-size: 8px; font-weight: 800; line-height: 1;
  padding: 3px 5px; border-radius: 999px; background: #EC4899; color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.charm-tag.best { background: #F59E0B; }
.charm-tag.out { background: #9CA3AF; }
.charm-tag.hid { background: #6B7280; }
.picker-card[aria-checked="true"] { border-color: #EC4899; box-shadow: 0 0 0 2px #FBCFE8; background: #FDF2F8; }
.picker-card[aria-disabled="true"] { opacity: .5; }

/* ------------------------------------------------------------ intro (~2.5 s) */
.intro {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, #fff 0%, #FFF5F6 45%, #FCE7F3 100%);
  overflow: hidden; cursor: pointer;
  /* Safety net: never cover the site for long, even if JavaScript fails. */
  animation: introAutoHide .4s ease 4s forwards;
}
.intro.is-hidden { display: none; }
.intro.is-leaving { animation: introLeave .6s cubic-bezier(.6,.05,.3,1) forwards; }
.intro.is-fading { animation: introFade .6s ease forwards; }
@keyframes introAutoHide { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@keyframes introLeave { to { transform: translateY(-100%); opacity: .9; visibility: hidden; } }
@keyframes introFade { to { opacity: 0; visibility: hidden; } }
.intro-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px; }
.intro-stage {
  position: relative; width: min(78vw, 340px); aspect-ratio: 1;
  animation: introDraw 1s cubic-bezier(.2,.8,.2,1) both;
}
.intro-stage canvas { width: 100%; height: 100%; display: block; }
@keyframes introDraw {
  from { clip-path: circle(0% at 50% 45%); transform: scale(.86) rotate(-8deg); opacity: 0; }
  to { clip-path: circle(75% at 50% 45%); transform: none; opacity: 1; }
}
.intro-title {
  font-size: 22px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  background: linear-gradient(100deg, #EC4899 20%, #FBCFE8 40%, #EC4899 60%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: introRise .6s ease .9s both, introShimmer 1.6s linear 1.1s infinite;
}
.intro-sub { font-size: 12px; color: #9CA3AF; animation: introRise .6s ease 1.1s both; }
@keyframes introRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes introShimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.intro-skip {
  position: absolute; right: 16px; top: calc(16px + env(safe-area-inset-top)); font-size: 12px; font-weight: 700;
  color: #EC4899; background: rgba(255,255,255,.8); border: 1px solid #FBCFE8; border-radius: 999px; padding: 6px 14px;
}
.intro-sparkles i {
  position: absolute; width: 10px; height: 10px; opacity: 0;
  background: radial-gradient(circle, #fff 0%, #F9A8D4 40%, rgba(236,72,153,0) 70%);
  border-radius: 50%; animation: introFloat 2.6s ease-in-out infinite;
}
.intro-sparkles i::after { content: "✦"; position: absolute; inset: -6px; color: #F472B6; font-size: 14px; text-align: center; }
.intro-sparkles i:nth-child(1) { left: 8%; top: 70%; animation-delay: 0s; }
.intro-sparkles i:nth-child(2) { left: 22%; top: 20%; animation-delay: .3s; }
.intro-sparkles i:nth-child(3) { left: 80%; top: 30%; animation-delay: .6s; }
.intro-sparkles i:nth-child(4) { left: 65%; top: 80%; animation-delay: .9s; }
.intro-sparkles i:nth-child(5) { left: 40%; top: 10%; animation-delay: 1.2s; }
.intro-sparkles i:nth-child(6) { left: 90%; top: 60%; animation-delay: .2s; }
.intro-sparkles i:nth-child(7) { left: 12%; top: 40%; animation-delay: .5s; }
.intro-sparkles i:nth-child(8) { left: 55%; top: 55%; animation-delay: .8s; }
.intro-sparkles i:nth-child(9) { left: 32%; top: 88%; animation-delay: 1.1s; }
.intro-sparkles i:nth-child(10) { left: 75%; top: 12%; animation-delay: 1.4s; }
.intro-sparkles i:nth-child(11) { left: 48%; top: 35%; animation-delay: 1.7s; }
.intro-sparkles i:nth-child(12) { left: 5%; top: 8%; animation-delay: 2s; }
@keyframes introFloat {
  0% { opacity: 0; transform: translateY(12px) scale(.6); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-40px) scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
  .intro, .intro-stage, .intro-title, .intro-sub, .intro-sparkles i { animation: none !important; }
  .intro { animation: introAutoHide .4s ease 3s forwards !important; }
  .intro-sparkles { display: none; }
  .intro.is-leaving, .intro.is-fading { animation: introFade .5s ease forwards !important; }
  .bling-effect, .animate-ping { animation: none !important; }
  .kbd-gtoast, .kbd-toast { transition: none; }
}
