/* CARROM KING polish layer (2026-11-03) — premium-feel overrides, loaded after main CSS */

/* --- typography --- */
body { line-height: 1.75; letter-spacing: 0.01em; text-rendering: optimizeLegibility; }
h1, h2, h3 { font-family: "Outfit", "Noto Sans SC", sans-serif; letter-spacing: -0.01em; line-height: 1.2; text-wrap: balance; }
p { text-wrap: pretty; }

/* --- smooth anchor scrolling, offset for fixed header --- */
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 84px; }

/* --- selection & focus --- */
::selection { background: hsl(43 75% 55% / 0.9); color: hsl(220 20% 8%); }
:focus-visible { outline: 2px solid hsl(43 75% 55%); outline-offset: 3px; border-radius: 4px; }

/* --- scrollbar --- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: hsl(220 20% 8%); }
::-webkit-scrollbar-thumb { background: hsl(220 15% 26%); border-radius: 8px; border: 2px solid hsl(220 20% 8%); }
::-webkit-scrollbar-thumb:hover { background: hsl(43 75% 55% / 0.65); }
html { scrollbar-color: hsl(220 15% 26%) hsl(220 20% 8%); }

/* --- interactive feel --- */
a, button { transition: color .25s ease, background-color .25s ease, border-color .25s ease, transform .25s ease, box-shadow .25s ease, opacity .25s ease; }
button:active, a:active { transform: translateY(1px); }
img, video { -webkit-user-drag: none; }

/* cards lift gently on hover (product & contact cards use rounded-2xl + border) */
.rounded-2xl.border { transition: transform .35s cubic-bezier(.22,.61,.36,1), box-shadow .35s ease, border-color .35s ease; }
.rounded-2xl.border:hover { transform: translateY(-4px); box-shadow: 0 18px 44px hsl(0 0% 0% / .38); border-color: hsl(43 75% 55% / .45); }

/* hero headline presence */
section h1 { text-shadow: 0 2px 30px hsl(0 0% 0% / .45); }

/* --- scroll reveal (JS adds .ck-io; initial state set by JS only, no-JS stays visible) --- */
.ck-io { opacity: 0; transform: translateY(26px); }
.ck-io.ck-in { opacity: 1; transform: none; transition: opacity .8s cubic-bezier(.22,.61,.36,1), transform .8s cubic-bezier(.22,.61,.36,1); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ck-io { opacity: 1; transform: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* --- hide broken AI rules-assistant entry (backend retired 2026-11; remove these rules to restore) --- */
button[aria-label="Open Rules Assistant"],
button[aria-label="打开规则助手"] { display: none !important; }
.fixed.bottom-24.right-6.z-50 { display: none !important; }

/* --- contact bar --- */
#ck-bar {
  position: fixed;
  z-index: 60;
  display: flex;
  gap: 10px;
  transition: opacity .3s ease, transform .3s ease;
}

#ck-bar.ck-bar-hide {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

@media (max-width: 767px) {
  body {
    padding-bottom: 72px;
  }

  #ck-bar {
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: hsl(220 20% 10% / .92);
    backdrop-filter: blur(10px);
    border-top: 1px solid hsl(43 75% 55% / .25);
  }

  #ck-bar a,
  #ck-bar button {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 999px;
    font-weight: 600;
  }

  #ck-bar-wa {
    background: #25D366;
    color: #06281a;
  }

  #ck-bar-wx {
    border: 1.5px solid hsl(43 75% 55%);
    color: hsl(43 75% 55%);
    background: transparent;
  }
}

@media (min-width: 768px) {
  #ck-bar {
    left: auto;
    right: 24px;
    bottom: 24px;
  }

  #ck-bar-wx {
    display: none;
  }

  #ck-bar-wa {
    padding: 12px 20px;
    border-radius: 999px;
    background: #25D366;
    color: #06281a;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 8px 24px hsl(0 0% 0% / .35);
  }
}

/* --- rules toggle buttons --- */
.ck-rules-toggle {
  display: inline-flex;
  margin: 10px 0 14px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid hsl(43 75% 55% / .7);
  color: hsl(43 75% 55%);
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.ck-rules-toggle:hover {
  background: hsl(43 75% 55% / .12);
}

/* --- section title decorative lines --- */
section#products h2::after,
section#rules h2::after,
section#contact h2::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin: 16px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, hsl(43 75% 55%), transparent);
}

/* --- hero title responsive sizing --- */
section h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  letter-spacing: -0.02em;
}

/* --- ux2 fix pack (post-verification) --- */
/* product-card WhatsApp CTA: compiled CSS lacks the new arbitrary bg class, set it explicitly */
#products a[href^="https://wa.me/"] { background-color: #25D366; border-radius: 999px; }
/* hero WhatsApp outline button: ensure green border (Tailwind default border follows currentColor, this locks it in) */
section:first-of-type a[href^="https://wa.me/"] { border-color: #25D366; }
/* footer contact line breathing room */
footer a[href^="https://wa.me/"] { margin-left: 10px; }
