/* WoW Templar — reusable, lightweight ice-fire button system */
:root {
  --templar-ice-white: #f3fcff;
  --templar-ice-cyan: #86efff;
  --templar-ice-blue: #3a9dff;
  --templar-ice-deep: #071725;
}

html body :is(
  .btn,
  button:not(.close):not(.launch-close):not(.modal-close),
  [role="button"],
  input[type="button"],
  input[type="submit"],
  input[type="reset"]
) {
  --ice-ring-opacity: .3;
  --ice-spark-opacity: .22;
  --ice-spark-low: .15;
  --ice-spin: 11s;
  --ice-sheen: 7.5s;
  --ice-glow: 0 0 8px rgba(67, 180, 255, .22), inset 0 0 12px rgba(83, 202, 255, .07);
  position: relative !important;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(145, 226, 255, .58) !important;
  border-radius: max(7px, var(--button-radius, .7rem));
  color: var(--templar-ice-white) !important;
  background-color: var(--templar-ice-deep) !important;
  background-image: linear-gradient(145deg, rgba(34, 86, 118, .38), rgba(5, 17, 31, .94) 56%, rgba(13, 38, 60, .9)) !important;
  box-shadow: var(--ice-glow) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .65);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, filter .22s ease !important;
  -webkit-tap-highlight-color: transparent;
}

html body :is(
  .btn,
  button:not(.close):not(.launch-close):not(.modal-close),
  [role="button"],
  input[type="button"],
  input[type="submit"],
  input[type="reset"]
)::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  opacity: var(--ice-ring-opacity);
  pointer-events: none;
  background: conic-gradient(from 15deg,
    transparent 0 10%, rgba(77, 180, 255, .14) 15%,
    #54baff 22%, #e5fdff 27%, #55e6ff 33%,
    transparent 42% 57%, rgba(79, 167, 255, .13) 63%,
    #a9f7ff 70%, #318dff 77%, transparent 86% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  transform-origin: center;
  animation: templar-ice-orbit var(--ice-spin) linear infinite,
             templar-ice-breathe 4.8s ease-in-out infinite alternate !important;
}

html body :is(
  .btn,
  button:not(.close):not(.launch-close):not(.modal-close),
  [role="button"],
  input[type="button"],
  input[type="submit"],
  input[type="reset"]
)::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  opacity: var(--ice-spark-opacity);
  pointer-events: none;
  mix-blend-mode: screen;
  background-image:
    radial-gradient(circle at 14% 28%, rgba(230, 252, 255, .95) 0 1px, transparent 1.7px),
    radial-gradient(circle at 75% 68%, rgba(94, 217, 255, .9) 0 1px, transparent 1.8px),
    radial-gradient(circle at 48% 15%, rgba(135, 190, 255, .8) 0 1px, transparent 1.6px),
    linear-gradient(110deg, transparent 0 41%, rgba(226, 251, 255, .25) 49%, rgba(92, 203, 255, .12) 51%, transparent 59% 100%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 220% 100%;
  background-position: 0 0, 0 0, 0 0, 150% 0;
  animation: templar-ice-sheen var(--ice-sheen) ease-in-out infinite;
}

/* Named variants are reusable; page contexts below apply them without
   changing button destinations or JavaScript behavior. */
html body :is(.ice-legendary, #inicio .btn.primary, #launchPreregister) {
  --ice-ring-opacity: .82;
  --ice-spark-opacity: .42;
  --ice-spark-low: .23;
  --ice-spin: 5.5s;
  --ice-sheen: 4.8s;
  --ice-glow: 0 0 12px rgba(82, 198, 255, .58), 0 0 26px rgba(32, 111, 255, .26), inset 0 0 18px rgba(112, 222, 255, .18);
}

html body :is(.ice-frost, .btn.ghost, .portal-card .btn) {
  --ice-ring-opacity: .4;
  --ice-spark-opacity: .24;
  --ice-spark-low: .15;
  --ice-spin: 9s;
  --ice-sheen: 7.2s;
}

html body :is(.ice-special, .nav-actions .btn, .auth-form .btn, .auth-options .text-button,
              .tab, .filter, .buy-mount, .copy, .realm-copy-btn, .avatar-action, .logout) {
  --ice-ring-opacity: .24;
  --ice-spark-opacity: .13;
  --ice-spark-low: .08;
  --ice-spin: 14s;
  --ice-sheen: 10s;
  --ice-glow: 0 0 5px rgba(74, 172, 235, .17), inset 0 0 10px rgba(75, 193, 244, .05);
}

/* The fixed social links are button-like outbound actions, so give them the
   same restrained ice finish while keeping their existing URLs and labels. */
html body :is(a[href*="discord.gg"], a[href*="tiktok.com/@"], a[href*="facebook.com/groups/"], a[href*="chat.whatsapp.com"]) {
  --ice-ring-opacity: .28;
  --ice-spark-opacity: .14;
  --ice-spark-low: .08;
  --ice-spin: 14s;
  --ice-sheen: 10s;
  position: relative !important;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(145, 226, 255, .58) !important;
  border-radius: 9px !important;
  color: var(--templar-ice-white) !important;
  background: linear-gradient(145deg, rgba(34, 86, 118, .46), rgba(5, 17, 31, .96) 60%) !important;
  box-shadow: 0 0 5px rgba(74, 172, 235, .17), inset 0 0 10px rgba(75, 193, 244, .05) !important;
  text-decoration: none !important;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, filter .22s ease !important;
}
html body :is(a[href*="discord.gg"], a[href*="tiktok.com/@"], a[href*="facebook.com/groups/"], a[href*="chat.whatsapp.com"])::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  opacity: var(--ice-ring-opacity);
  pointer-events: none;
  background: conic-gradient(from 15deg, transparent 0 12%, #54baff 24%, #e5fdff 30%, #55e6ff 38%, transparent 52% 65%, #a9f7ff 76%, #318dff 84%, transparent 92% 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  transform-origin: center;
  animation: templar-ice-orbit var(--ice-spin) linear infinite,
             templar-ice-breathe 4.8s ease-in-out infinite alternate !important;
}
html body :is(a[href*="discord.gg"], a[href*="tiktok.com/@"], a[href*="facebook.com/groups/"], a[href*="chat.whatsapp.com"])::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  opacity: var(--ice-spark-opacity);
  pointer-events: none;
  mix-blend-mode: screen;
  background-image: radial-gradient(circle at 18% 28%, rgba(230,252,255,.9) 0 1px, transparent 1.7px), linear-gradient(110deg, transparent 0 41%, rgba(226,251,255,.25) 49%, rgba(92,203,255,.12) 51%, transparent 59% 100%);
  background-size: 100% 100%, 220% 100%;
  background-position: 0 0, 150% 0;
  animation: templar-ice-sheen var(--ice-sheen) ease-in-out infinite;
}

/* Navigation stays visually quiet until interaction. */
html body :is(.nav-links a, .nav-dropdown > summary, .foot-links a) {
  text-decoration-color: transparent;
  text-underline-offset: .35em;
  transition: color .2s ease, text-shadow .2s ease, text-decoration-color .2s ease;
}
html body :is(.nav-links a:hover, .nav-dropdown > summary:hover, .foot-links a:hover,
               .nav-links a:focus-visible, .nav-dropdown > summary:focus-visible, .foot-links a:focus-visible) {
  color: #effcff !important;
  text-decoration: underline;
  text-decoration-color: rgba(122, 225, 255, .8);
  text-shadow: 0 0 10px rgba(60, 176, 255, .46);
}
html body :is(a[href*="discord.gg"], a[href*="tiktok.com/@"], a[href*="facebook.com/groups/"], a[href*="chat.whatsapp.com"]):focus-visible {
  outline: 3px solid #e9fcff !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(61, 173, 255, .38), 0 0 22px rgba(92, 216, 255, .7) !important;
}

@media (hover: hover) and (pointer: fine) {
  html body :is(a[href*="discord.gg"], a[href*="tiktok.com/@"], a[href*="facebook.com/groups/"], a[href*="chat.whatsapp.com"]):hover {
    border-color: rgba(189, 245, 255, .95) !important;
    box-shadow: 0 0 14px rgba(81, 202, 255, .45), 0 0 28px rgba(38, 121, 255, .22), inset 0 0 15px rgba(139, 234, 255, .17) !important;
    filter: brightness(1.12);
    transform: translateY(-2px);
  }
}

@media (hover: hover) and (pointer: fine) {
  html body :is(.btn, button:not(.close):not(.launch-close):not(.modal-close), [role="button"], input[type="button"], input[type="submit"], input[type="reset"]):not(:disabled):not([aria-disabled="true"]):hover {
    border-color: rgba(189, 245, 255, .95) !important;
    box-shadow: 0 0 14px rgba(81, 202, 255, .45), 0 0 28px rgba(38, 121, 255, .22), inset 0 0 15px rgba(139, 234, 255, .17) !important;
    filter: brightness(1.12);
    transform: translateY(-2px);
  }
  html body :is(.btn, button:not(.close):not(.launch-close):not(.modal-close), [role="button"], input[type="button"], input[type="submit"], input[type="reset"]):not(:disabled):not([aria-disabled="true"]):hover::before {
    opacity: 1;
  }
  html body :is(.btn, button:not(.close):not(.launch-close):not(.modal-close), [role="button"], input[type="button"], input[type="submit"], input[type="reset"]):not(:disabled):not([aria-disabled="true"]):hover::after {
    opacity: .62;
  }
}

html body :is(.btn, button:not(.close):not(.launch-close):not(.modal-close), [role="button"], input[type="button"], input[type="submit"], input[type="reset"]):focus-visible {
  outline: 3px solid #e9fcff !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(61, 173, 255, .38), 0 0 22px rgba(92, 216, 255, .7) !important;
}

html body :is(.btn, button:not(.close):not(.launch-close):not(.modal-close), [role="button"], input[type="button"], input[type="submit"], input[type="reset"]):not(:disabled):not([aria-disabled="true"]):active {
  filter: brightness(1.2);
  transform: translateY(1px) scale(.985);
  box-shadow: 0 0 19px rgba(96, 215, 255, .68), inset 0 0 18px rgba(112, 222, 255, .24) !important;
}

html body :is(.btn, button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"]):disabled,
html body :is(.btn, button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"])[aria-disabled="true"] {
  cursor: not-allowed !important;
  opacity: .48 !important;
  filter: grayscale(.65) !important;
  box-shadow: none !important;
  transform: none !important;
}
html body :is(.btn, button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"]):disabled::before,
html body :is(.btn, button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"]):disabled::after,
html body :is(.btn, button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"])[aria-disabled="true"]::before,
html body :is(.btn, button, [role="button"], input[type="button"], input[type="submit"], input[type="reset"])[aria-disabled="true"]::after {
  animation: none !important;
  opacity: .08 !important;
}

@keyframes templar-ice-orbit { to { transform: rotate(1turn); } }
@keyframes templar-ice-breathe { from { filter: brightness(.8); } to { filter: brightness(1.22); } }
@keyframes templar-ice-sheen {
  0%, 22% { background-position: 0 0, 0 0, 0 0, 150% 0; opacity: var(--ice-spark-opacity); }
  58%, 100% { background-position: 0 0, 0 0, 0 0, -150% 0; opacity: var(--ice-spark-low); }
}

@media (max-width: 640px) {
  html body :is(.btn, button:not(.close):not(.launch-close):not(.modal-close), [role="button"], input[type="button"], input[type="submit"], input[type="reset"]) {
    min-height: 42px;
  }
  html body :is(#inicio .btn.primary, #launchPreregister) { --ice-spark-opacity: .3; --ice-spark-low: .17; }
  html body div:has(> a[href*="discord.gg"]):has(> a[href*="tiktok.com/@"]) {
    position: static !important;
    inset: auto !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px !important;
    width: fit-content;
    max-width: 100%;
    margin: 18px auto !important;
    padding: 10px !important;
    border-radius: 12px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body :is(.btn, button:not(.close):not(.launch-close):not(.modal-close), [role="button"], input[type="button"], input[type="submit"], input[type="reset"]),
  html body :is(.nav-links a, .nav-dropdown > summary, .foot-links a) {
    animation: none !important;
    transition: none !important;
  }
  html body :is(.btn, button:not(.close):not(.launch-close):not(.modal-close), [role="button"], input[type="button"], input[type="submit"], input[type="reset"]):hover,
  html body :is(.btn, button:not(.close):not(.launch-close):not(.modal-close), [role="button"], input[type="button"], input[type="submit"], input[type="reset"]):active {
    transform: none !important;
  }
  html body :is(.btn, button:not(.close):not(.launch-close):not(.modal-close), [role="button"], input[type="button"], input[type="submit"], input[type="reset"])::before,
  html body :is(.btn, button:not(.close):not(.launch-close):not(.modal-close), [role="button"], input[type="button"], input[type="submit"], input[type="reset"])::after {
    animation: none !important;
  }
  html body :is(a[href*="discord.gg"], a[href*="tiktok.com/@"], a[href*="facebook.com/groups/"], a[href*="chat.whatsapp.com"])::before,
  html body :is(a[href*="discord.gg"], a[href*="tiktok.com/@"], a[href*="facebook.com/groups/"], a[href*="chat.whatsapp.com"])::after {
    animation: none !important;
  }
}
