/* ALEF button system: shared visuals only; form and WooCommerce behavior stays untouched. */
:root{
  --ags-button-primary:linear-gradient(112deg,#55d9ec 0%,#648ff7 52%,#a77cf2 100%);
  --ags-button-secondary:linear-gradient(145deg,#15283a 0%,#0a1724 100%);
  --ags-button-danger:linear-gradient(145deg,#59263d 0%,#2b1725 100%);
  --ags-button-focus:#e5dcff;
}

/* Primary CTAs: store, purchase, account, wallet top-up, and payment. */
body :is(
  .ags-home-v5 .ags-v5-button.primary,
  .ags-v4-btn.primary,
  .ags-home-btn.primary,
  .ags-w-btn.primary,
  .ags-cta,
  .ags-auth-v2-primary,
  .ags-account-primary-action:not(.danger),
  .ags-ac-btn:not(.secondary):not(.ags-ac-btn-danger),
  .ags-tf2-primary,
  .ags-tf2-form .button,
  .ags-single-add,
  .ags-gift-add-cart,
  .ags-topup-submit,
  .ags-market-buy-button,
  .ags-market-submit,
  .ags-m2-primary,
  :where(#ags-sub-add),
  .woocommerce a.checkout-button,
  .woocommerce button.single_add_to_cart_button,
  .woocommerce input.single_add_to_cart_button,
  .woocommerce .product :where(.button:not(.remove):not(.added_to_cart)),
  :where(.woocommerce #place_order)
){
  box-sizing:border-box!important;
  min-height:48px!important;
  height:auto!important;
  padding:11px 18px!important;
  border:1px solid rgba(148,221,255,.72)!important;
  border-radius:14px!important;
  background:var(--ags-button-primary)!important;
  background-size:180% 100%!important;
  background-position:0 50%!important;
  color:#07131f!important;
  font-family:inherit!important;
  font-size:13px!important;
  font-weight:900!important;
  line-height:1.4!important;
  text-align:center;
  text-decoration:none!important;
  vertical-align:middle;
  box-shadow:inset 0 1px rgba(255,255,255,.34),0 9px 23px rgba(91,119,255,.20),0 0 0 1px rgba(86,209,238,.06)!important;
  transition:transform .18s ease,background-position .38s ease,box-shadow .22s ease,border-color .2s ease!important;
}

/* These two platform controls use IDs, so keep their specificity local. */
body #ags-sub-add,
body .woocommerce #place_order{
  box-sizing:border-box!important;min-height:48px!important;height:auto!important;padding:11px 18px!important;
  border:1px solid rgba(148,221,255,.72)!important;border-radius:14px!important;
  background:var(--ags-button-primary)!important;background-size:180% 100%!important;background-position:0 50%!important;
  color:#07131f!important;font-family:inherit!important;font-size:13px!important;font-weight:900!important;line-height:1.4!important;
  text-align:center;text-decoration:none!important;vertical-align:middle;
  box-shadow:inset 0 1px rgba(255,255,255,.34),0 9px 23px rgba(91,119,255,.20),0 0 0 1px rgba(86,209,238,.06)!important;
  transition:transform .18s ease,background-position .38s ease,box-shadow .22s ease,border-color .2s ease!important;
}

/* A wallet withdrawal is deliberately secondary; the hidden intent field is its stable marker. */
body .ags-wallet-action-card form input[name="ags_wallet_withdraw"] ~ .ags-account-primary-action,
body #ags-account-center .ags-wallet-action-card form input[name="ags_wallet_withdraw"] ~ .ags-account-primary-action{
  min-height:48px!important;height:auto!important;padding:11px 18px!important;
  border:1px solid rgba(110,188,226,.38)!important;border-radius:14px!important;
  background:var(--ags-button-secondary)!important;background-size:100% 100%!important;background-position:0 50%!important;color:#eaf5fd!important;
  box-shadow:inset 0 1px rgba(255,255,255,.06)!important;
  transition:transform .18s ease,border-color .2s ease,box-shadow .2s ease!important;
}

/* Secondary actions, cancel buttons, and low-priority navigation. */
body :is(
  .ags-home-v5 .ags-v5-button.secondary,
  .ags-v4-btn.secondary,
  .ags-home-btn.ghost,
  .ags-w-btn:not(.primary),
  .ags-m2-secondary,
  .ags-ac-btn.secondary,
  .ags-trade-cancel-form .ags-ac-btn,
  .ags-delete-confirm-cancel,
  .ags-topup-cancel,
  .woocommerce .coupon .button,
  .woocommerce .return-to-shop .button
){
  box-sizing:border-box!important;
  min-height:48px!important;height:auto!important;padding:11px 18px!important;
  border:1px solid rgba(110,188,226,.38)!important;border-radius:14px!important;
  background:var(--ags-button-secondary)!important;color:#eaf5fd!important;
  font-family:inherit!important;font-size:13px!important;font-weight:800!important;line-height:1.4!important;
  text-align:center;text-decoration:none!important;vertical-align:middle;
  box-shadow:inset 0 1px rgba(255,255,255,.06)!important;
  transition:transform .18s ease,border-color .2s ease,box-shadow .2s ease!important;
}

/* Dangerous actions never look like purchases. */
body :is(.ags-delete-confirm-submit,.ags-account-primary-action.danger,.ags-ac-btn-danger){
  box-sizing:border-box!important;
  min-height:48px!important;height:auto!important;padding:11px 18px!important;
  border:1px solid rgba(255,137,164,.58)!important;border-radius:14px!important;
  background:var(--ags-button-danger)!important;color:#ffe8ed!important;
  font-family:inherit!important;font-size:13px!important;font-weight:900!important;line-height:1.4!important;
  text-align:center;text-decoration:none!important;vertical-align:middle;
  box-shadow:inset 0 1px rgba(255,255,255,.07),0 8px 22px rgba(210,52,97,.16)!important;
  transition:transform .18s ease,filter .2s ease,box-shadow .2s ease!important;
}
body .woocommerce a.remove{
  border:1px solid rgba(255,121,154,.28)!important;border-radius:9px!important;
  background:rgba(190,49,83,.12)!important;color:#ff91aa!important;
}

/* The account dashboard has older ID-scoped rules; override them deliberately. */
body #ags-account-center .ags-ac-btn:not(.secondary):not(.ags-ac-btn-danger){
  box-sizing:border-box!important;min-height:48px!important;height:auto!important;padding:11px 18px!important;
  border:1px solid rgba(148,221,255,.72)!important;border-radius:14px!important;
  background:var(--ags-button-primary)!important;background-size:180% 100%!important;background-position:0 50%!important;
  color:#07131f!important;font-family:inherit!important;font-size:13px!important;font-weight:900!important;line-height:1.4!important;
  text-align:center;text-decoration:none!important;vertical-align:middle;
  box-shadow:inset 0 1px rgba(255,255,255,.34),0 9px 23px rgba(91,119,255,.20),0 0 0 1px rgba(86,209,238,.06)!important;
  transition:transform .18s ease,background-position .38s ease,box-shadow .22s ease,border-color .2s ease!important;
}
body #ags-account-center .ags-ac-btn.secondary{
  box-sizing:border-box!important;min-height:48px!important;height:auto!important;padding:11px 18px!important;
  border:1px solid rgba(110,188,226,.38)!important;border-radius:14px!important;
  background:var(--ags-button-secondary)!important;color:#eaf5fd!important;
  font-family:inherit!important;font-size:13px!important;font-weight:800!important;line-height:1.4!important;
  text-align:center;text-decoration:none!important;vertical-align:middle;
  box-shadow:inset 0 1px rgba(255,255,255,.06)!important;
  transition:transform .18s ease,border-color .2s ease,box-shadow .2s ease!important;
}
body #ags-account-center .ags-ac-btn-danger,
body .ags-withdrawal-cancel-form .ags-account-primary-action.danger{
  box-sizing:border-box!important;min-height:48px!important;height:auto!important;padding:11px 18px!important;
  border:1px solid rgba(255,137,164,.58)!important;border-radius:14px!important;
  background:var(--ags-button-danger)!important;color:#ffe8ed!important;
  font-family:inherit!important;font-size:13px!important;font-weight:900!important;line-height:1.4!important;
  text-align:center;text-decoration:none!important;vertical-align:middle;
  box-shadow:inset 0 1px rgba(255,255,255,.07),0 8px 22px rgba(210,52,97,.16)!important;
  transition:transform .18s ease,filter .2s ease,box-shadow .2s ease!important;
}

@media(hover:hover){
  body :is(
    .ags-home-v5 .ags-v5-button.primary,.ags-v4-btn.primary,.ags-home-btn.primary,.ags-w-btn.primary,
    .ags-cta,.ags-auth-v2-primary,.ags-account-primary-action:not(.danger),
    .ags-ac-btn:not(.secondary):not(.ags-ac-btn-danger),.ags-tf2-primary,.ags-tf2-form .button,
    .ags-single-add,.ags-gift-add-cart,.ags-topup-submit,.ags-market-buy-button,.ags-market-submit,
    .ags-m2-primary,:where(#ags-sub-add),.woocommerce a.checkout-button,
    .woocommerce button.single_add_to_cart_button,.woocommerce input.single_add_to_cart_button,
    .woocommerce .product :where(.button:not(.remove):not(.added_to_cart)),:where(.woocommerce #place_order)
  ):hover:not(:disabled):not([aria-disabled="true"]){
    transform:translateY(-2px)!important;background-position:100% 50%!important;
    border-color:rgba(199,193,255,.95)!important;
    box-shadow:inset 0 1px rgba(255,255,255,.4),0 14px 30px rgba(91,119,255,.28),0 0 20px rgba(79,211,239,.12)!important;
  }
  body #ags-sub-add:hover:not(:disabled),body .woocommerce #place_order:hover:not(:disabled){
    transform:translateY(-2px)!important;background-position:100% 50%!important;border-color:rgba(199,193,255,.95)!important;
    box-shadow:inset 0 1px rgba(255,255,255,.4),0 14px 30px rgba(91,119,255,.28),0 0 20px rgba(79,211,239,.12)!important;
  }
  body :is(
    .ags-home-v5 .ags-v5-button.secondary,.ags-v4-btn.secondary,.ags-home-btn.ghost,
    .ags-w-btn:not(.primary),.ags-m2-secondary,.ags-ac-btn.secondary,
    .ags-trade-cancel-form .ags-ac-btn,.ags-delete-confirm-cancel,.ags-topup-cancel,
    .woocommerce .coupon .button,.woocommerce .return-to-shop .button
  ):hover:not(:disabled):not([aria-disabled="true"]){
    transform:translateY(-1px)!important;border-color:rgba(111,216,246,.68)!important;
    box-shadow:0 9px 22px rgba(35,118,160,.14),inset 0 1px rgba(255,255,255,.07)!important;
  }
  body :is(.ags-delete-confirm-submit,.ags-account-primary-action.danger,.ags-ac-btn-danger):hover:not(:disabled){
    transform:translateY(-1px)!important;filter:brightness(1.12);
    box-shadow:0 12px 25px rgba(210,52,97,.23)!important;
  }
  body #ags-account-center .ags-ac-btn:not(.secondary):not(.ags-ac-btn-danger):hover:not(:disabled),
  body .ags-wallet-action-card form input[name="ags_wallet_topup"] ~ .ags-account-primary-action:hover:not(:disabled){
    transform:translateY(-2px)!important;background-position:100% 50%!important;border-color:rgba(199,193,255,.95)!important;
    box-shadow:inset 0 1px rgba(255,255,255,.4),0 14px 30px rgba(91,119,255,.28),0 0 20px rgba(79,211,239,.12)!important;
  }
  body #ags-account-center .ags-ac-btn.secondary:hover:not(:disabled){
    transform:translateY(-1px)!important;border-color:rgba(111,216,246,.68)!important;
    box-shadow:0 9px 22px rgba(35,118,160,.14),inset 0 1px rgba(255,255,255,.07)!important;
  }
  body .ags-wallet-action-card form input[name="ags_wallet_withdraw"] ~ button.ags-account-primary-action:hover:not(:disabled),
  body #ags-account-center .ags-wallet-action-card form input[name="ags_wallet_withdraw"] ~ button.ags-account-primary-action:hover:not(:disabled){
    transform:translateY(-1px)!important;background-position:0 50%!important;border-color:rgba(111,216,246,.68)!important;
    box-shadow:0 9px 22px rgba(35,118,160,.14),inset 0 1px rgba(255,255,255,.07)!important;
  }
  body #ags-account-center .ags-ac-btn-danger:hover:not(:disabled),
  body .ags-withdrawal-cancel-form .ags-account-primary-action.danger:hover:not(:disabled){
    transform:translateY(-1px)!important;filter:brightness(1.12);
    box-shadow:0 12px 25px rgba(210,52,97,.23)!important;
  }
}

/* Keyboard focus stays conspicuous without changing mouse focus behavior. */
body :is(
  .ags-home-v5 .ags-v5-button,.ags-v4-btn,.ags-home-btn,.ags-w-btn,.ags-cta,
  .ags-auth-v2-primary,.ags-account-primary-action,.ags-ac-btn,.ags-tf2-primary,
  .ags-tf2-form .button,.ags-single-add,.ags-gift-add-cart,.ags-topup-submit,
  .ags-market-buy-button,.ags-market-submit,.ags-m2-primary,.ags-m2-secondary,:where(#ags-sub-add),
  .ags-delete-confirm-submit,.ags-delete-confirm-cancel,.ags-ac-btn-danger,.ags-ac-btn.secondary,
  .woocommerce a.checkout-button,.woocommerce .product :where(.button),:where(.woocommerce #place_order)
):focus-visible{
  outline:2px solid var(--ags-button-focus)!important;outline-offset:3px!important;
  box-shadow:0 0 0 5px rgba(94,211,255,.2),0 10px 25px rgba(83,113,255,.2)!important;
}
body #ags-sub-add:focus-visible,body .woocommerce #place_order:focus-visible{
  outline:2px solid var(--ags-button-focus)!important;outline-offset:3px!important;
  box-shadow:0 0 0 5px rgba(94,211,255,.2),0 10px 25px rgba(83,113,255,.2)!important;
}

/* Disabled and loading are visual states only; original submit behavior is unchanged. */
body :is(
  .ags-home-v5 .ags-v5-button,.ags-v4-btn,.ags-home-btn,.ags-w-btn,.ags-cta,
  .ags-auth-v2-primary,.ags-account-primary-action,.ags-ac-btn,.ags-tf2-primary,
  .ags-tf2-form .button,.ags-single-add,.ags-gift-add-cart,.ags-topup-submit,
  .ags-market-buy-button,.ags-market-submit,.ags-m2-primary,.ags-m2-secondary,:where(#ags-sub-add),
  .ags-delete-confirm-submit,.ags-delete-confirm-cancel,.ags-ac-btn-danger,.ags-ac-btn.secondary,
  .woocommerce a.checkout-button,.woocommerce .product :where(.button),:where(.woocommerce #place_order)
):is(:disabled,[disabled],[aria-disabled="true"],.disabled){
  opacity:.62!important;cursor:not-allowed!important;transform:none!important;box-shadow:none!important;
}
body #ags-sub-add:disabled,body #ags-sub-add[disabled],body #ags-sub-add[aria-disabled="true"],
body .woocommerce #place_order:disabled,body .woocommerce #place_order[disabled],body .woocommerce #place_order[aria-disabled="true"]{
  opacity:.62!important;cursor:not-allowed!important;transform:none!important;box-shadow:none!important;
}
body :is(
  .ags-home-v5 .ags-v5-button,.ags-v4-btn,.ags-home-btn,.ags-w-btn,.ags-cta,
  .ags-auth-v2-primary,.ags-account-primary-action,.ags-ac-btn,.ags-tf2-primary,
  .ags-tf2-form .button,.ags-single-add,.ags-gift-add-cart,.ags-topup-submit,
  .ags-market-buy-button,.ags-market-submit,.ags-m2-primary,:where(#ags-sub-add),.woocommerce .button
):is(.loading,.is-loading,.processing){cursor:progress!important}

@media(prefers-reduced-motion:reduce){
  body :is(
    .ags-home-v5 .ags-v5-button,.ags-v4-btn,.ags-home-btn,.ags-w-btn,.ags-cta,
    .ags-auth-v2-primary,.ags-account-primary-action,.ags-ac-btn,.ags-tf2-primary,
    .ags-tf2-form .button,.ags-single-add,.ags-gift-add-cart,.ags-topup-submit,
    .ags-market-buy-button,.ags-market-submit,.ags-m2-primary,.ags-m2-secondary,:where(#ags-sub-add),
    .ags-delete-confirm-submit,.ags-delete-confirm-cancel,.woocommerce .button
  ){transition:none!important}
  body :is(
    .ags-home-v5 .ags-v5-button,.ags-v4-btn,.ags-home-btn,.ags-w-btn,.ags-cta,
    .ags-auth-v2-primary,.ags-account-primary-action,.ags-ac-btn,.ags-tf2-primary,
    .ags-tf2-form .button,.ags-single-add,.ags-gift-add-cart,.ags-topup-submit,
    .ags-market-buy-button,.ags-market-submit,.ags-m2-primary,.ags-m2-secondary,:where(#ags-sub-add),
    .ags-delete-confirm-submit,.ags-delete-confirm-cancel,.woocommerce .button
  ):hover{transform:none!important}
  body #ags-account-center .ags-ac-btn,
  body #ags-sub-add,
  body .woocommerce #place_order{transition:none!important}
  body #ags-account-center .ags-ac-btn:hover,
  body #ags-sub-add:hover,
  body .woocommerce #place_order:hover{transform:none!important}
}
